-
Notifications
You must be signed in to change notification settings - Fork 742
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 #897
Conversation
It was not used anywhere
Previously, we executed processings first and updated the state afterward. This approach could be problematic for asynchronous key processing, as Fleet might access the current state, which, in the context of async key processing, is a snapshot before execution and does not reflect the actual current KeyHandlerState
@@ -95,6 +95,18 @@ public class ExEntryPanelService : VimCommandLineService { | |||
return panel | |||
} | |||
|
|||
public override fun createWithoutShortcuts( |
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.
createSomething
usually used when we actually create a new instance of the object.
Here we reuse initialized instance of the ExEntryPanel, so I'd say that this method should be named also getInstance....
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.
In IdeaVim, we reuse the initialized instance, but this is unlikely to be the case for Fleet. The implementation details of IdeaVim should not influence naming of the new API
Previously, we used getInstanceWithoutShortcuts()
and then called activate()
on it. Now, however, we have adopted a more intuitive approach by directly calling createWithoutShortcuts()
@@ -11,6 +11,8 @@ package com.maddyhome.idea.vim.api | |||
import javax.swing.KeyStroke | |||
|
|||
public interface VimCommandLine { | |||
public val caret: VimCommandLineCaret |
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.
I don't understand why this change is included in this commit.
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.
I don't have any objective reason for this; I just felt that this field would look better at the top of the class and didn't want to create a separate commit for such a minor change
@@ -209,11 +207,11 @@ private void setFontToJField(String stringToDisplay) { | |||
|
|||
void setEditor(@NotNull Editor editor, DataContext context) { | |||
this.context = context; | |||
EditorHolderService.getInstance().setEditor(editor); | |||
ExEntryPanel.getInstance().setEditor(editor); | |||
} | |||
|
|||
public Editor getEditor() { |
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.
This requires @Nullable
on return type now
|
||
/** | ||
* The type of the last used pattern. | ||
*/ | ||
private var lastPatternType: PatternType? = null | ||
@JvmStatic |
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.
Why do we need all new @JvmStatic
? I see that their usage was moved from java class to kotlin class.
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.
It's Kotlin magic to make protected fields in companion objects work
One more set of changes for Fleet