-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fleet #824
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AlexPl292
reviewed
Feb 16, 2024
import javax.swing.KeyStroke | ||
|
||
public class CommandBuilder(private var currentCommandPartNode: CommandPartNode<LazyVimCommand>) { | ||
private val commandParts = ArrayDeque<Command>() | ||
public class CommandBuilder(private var currentCommandPartNode: CommandPartNode<LazyVimCommand>): Cloneable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AlexPl292
reviewed
Feb 16, 2024
synchronized(lock) { | ||
val keyHandler = KeyHandler.getInstance() | ||
if (keyHandler.keyHandlerState != originalState) { | ||
logger.warn("Unexpected editor state. Aborting command execution.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we miss return
here?
Review notes:
Additional notes:
|
lippfi
force-pushed
the
fleet
branch
2 times, most recently
from
February 18, 2024 01:11
9855865
to
0d7cfc3
Compare
Rationale: 1. A much more experienced developer, whom I highly respect, suggested to empty VimStateMachineImpl constructor in his TODO comment. 2. I aim for VimStateMachine to be a data class rather than being a container for both data and complex logic. 3. From an architectural perspective, it is more correct. Editors do have state (or they may possess a single global state if the corresponding option is set), but a state does not own an editor.
1. Listeners now disposed after turning plugin off 2. Change widget listeners to be recreated on plugin toggle 3. Add CaretVisualAttributesListener
It will not only simplify VimStateMachine, but also help us to support multi-editor macros in future
…with the new UI and will be replaced with widget
It unnecessarily binds mappingState to mode and thus to editor. And we want to simplify things and have a single MappingState instead of multiple of them
We do not need multiple commandBuilder, digraphSequence or mappingState and this class will be a singleton containing them
Applying default values may lead to unexpected results, especially if we sometimes want to use the global state (IJ), and at other times, its clone for asynchronous processing (Fleet).
It will help us to build the KeyProcessResult that we need for asynchronous key processing
It will help us to have a more modular KeyHandler in future (chain of different consumers)
It shouldn't be retested on partial reset
…and changing of the KeyHandlerState
Bad commands are handled in consumers
It may indicate some serious issues, and we would like to know if anything goes wrong
It will simplify support of immutable editors in Fleet
# Conflicts: # vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api/VimEditorGroup.kt # vim-engine/src/main/kotlin/com/maddyhome/idea/vim/impl/state/VimStateMachineImpl.kt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.