Factored out execute function for the main loop #455
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most commands are factored out to the function, except:
This should be enough to implement
ContextValidator::invoke
.Also this commit brings
CompleteHint
,SelfInsert
,Insert
commandsto the
match
overCmd
instead of keeping them as separateif
statements as latter doesn't seem to change their behavior.
This is needed to implement #453, and #293 (although, latter might need
input-accepting commands too or another approach).
This is somewhat super-minimal refactoring to move closer to our goal of invoking commands from
ContextValidator::invoke
or any other user hooks.I think
input_mode.is_emacs_mode()
and a reference tokill_ring
can also be incorporated intoState
object. So the only thing we need to propagate through the call chain isState
. What do you think? (this can be a follow-up PR anyway)