mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-06-02 22:34:08 +02:00
Remove ExEntryPanel and move its method to VimCommandLine
This commit is contained in:
parent
c83ecc46ed
commit
ae4b88a06b
src/main/java/com/maddyhome/idea/vim
vim-engine/src/main/kotlin/com/maddyhome/idea/vim
@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2003-2023 The IdeaVim authors
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by an MIT-style
|
|
||||||
* license that can be found in the LICENSE.txt file or at
|
|
||||||
* https://opensource.org/licenses/MIT.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.newapi
|
|
||||||
|
|
||||||
import com.intellij.openapi.components.Service
|
|
||||||
import com.maddyhome.idea.vim.api.ExEntryPanel
|
|
||||||
|
|
||||||
@Service
|
|
||||||
internal class IjExEntryPanel : ExEntryPanel {
|
|
||||||
override fun clearCurrentAction() {
|
|
||||||
com.maddyhome.idea.vim.ui.ex.ExEntryPanel.getInstance().entry.clearCurrentAction()
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,7 +14,6 @@ import com.intellij.openapi.diagnostic.Logger
|
|||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.editor.textarea.TextComponentEditorImpl
|
import com.intellij.openapi.editor.textarea.TextComponentEditorImpl
|
||||||
import com.maddyhome.idea.vim.api.EngineEditorHelper
|
import com.maddyhome.idea.vim.api.EngineEditorHelper
|
||||||
import com.maddyhome.idea.vim.api.ExEntryPanel
|
|
||||||
import com.maddyhome.idea.vim.api.ExecutionContextManager
|
import com.maddyhome.idea.vim.api.ExecutionContextManager
|
||||||
import com.maddyhome.idea.vim.api.LocalOptionInitialisationScenario
|
import com.maddyhome.idea.vim.api.LocalOptionInitialisationScenario
|
||||||
import com.maddyhome.idea.vim.api.NativeActionManager
|
import com.maddyhome.idea.vim.api.NativeActionManager
|
||||||
@ -107,8 +106,6 @@ internal class IjVimInjector : VimInjectorBase() {
|
|||||||
|
|
||||||
override val actionExecutor: VimActionExecutor
|
override val actionExecutor: VimActionExecutor
|
||||||
get() = service<IjActionExecutor>()
|
get() = service<IjActionExecutor>()
|
||||||
override val exEntryPanel: ExEntryPanel
|
|
||||||
get() = service<IjExEntryPanel>()
|
|
||||||
override val exOutputPanel: VimExOutputPanelService
|
override val exOutputPanel: VimExOutputPanelService
|
||||||
get() = object : VimExOutputPanelService {
|
get() = object : VimExOutputPanelService {
|
||||||
override fun getPanel(editor: VimEditor): VimExOutputPanel {
|
override fun getPanel(editor: VimEditor): VimExOutputPanel {
|
||||||
|
@ -492,6 +492,16 @@ public class ExEntryPanel extends JPanel implements VimCommandLine {
|
|||||||
entry.updateText(string);
|
entry.updateText(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearPromptCharacter() {
|
||||||
|
entry.clearCurrentActionPromptCharacter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clearCurrentAction() {
|
||||||
|
entry.clearCurrentAction();
|
||||||
|
}
|
||||||
|
|
||||||
public static class LafListener implements LafManagerListener {
|
public static class LafListener implements LafManagerListener {
|
||||||
@Override
|
@Override
|
||||||
public void lookAndFeelChanged(@NotNull LafManager source) {
|
public void lookAndFeelChanged(@NotNull LafManager source) {
|
||||||
|
@ -333,7 +333,7 @@ public class ExTextField extends JTextField {
|
|||||||
setCaretPosition(currentActionPromptCharacterOffset);
|
setCaretPosition(currentActionPromptCharacterOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearCurrentActionPromptCharacter() {
|
void clearCurrentActionPromptCharacter() {
|
||||||
final int offset = getCaretPosition();
|
final int offset = getCaretPosition();
|
||||||
final String text = removePromptCharacter();
|
final String text = removePromptCharacter();
|
||||||
updateText(text);
|
updateText(text);
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2003-2023 The IdeaVim authors
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by an MIT-style
|
|
||||||
* license that can be found in the LICENSE.txt file or at
|
|
||||||
* https://opensource.org/licenses/MIT.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.api
|
|
||||||
|
|
||||||
public interface ExEntryPanel {
|
|
||||||
@Deprecated("Remove it after completely removing Swing TextActions")
|
|
||||||
public fun clearCurrentAction()
|
|
||||||
}
|
|
@ -33,4 +33,7 @@ public interface VimCommandLine {
|
|||||||
public fun deactivate(refocusOwningEditor: Boolean, resetCaret: Boolean)
|
public fun deactivate(refocusOwningEditor: Boolean, resetCaret: Boolean)
|
||||||
|
|
||||||
public fun setPromptCharacter(char: Char)
|
public fun setPromptCharacter(char: Char)
|
||||||
|
public fun clearPromptCharacter()
|
||||||
|
|
||||||
|
public fun clearCurrentAction()
|
||||||
}
|
}
|
@ -108,9 +108,6 @@ public interface VimInjector {
|
|||||||
// Can't be fully moved to vim-engine.
|
// Can't be fully moved to vim-engine.
|
||||||
public val actionExecutor: VimActionExecutor
|
public val actionExecutor: VimActionExecutor
|
||||||
|
|
||||||
// Can't be fully moved to vim-engine.
|
|
||||||
public val exEntryPanel: ExEntryPanel
|
|
||||||
|
|
||||||
// Can't be fully moved to vim-engine.
|
// Can't be fully moved to vim-engine.
|
||||||
public val exOutputPanel: VimExOutputPanelService
|
public val exOutputPanel: VimExOutputPanelService
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public class DigraphConsumer : KeyConsumer {
|
|||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
keyProcessResultBuilder.addExecutionStep { _, _, _ ->
|
keyProcessResultBuilder.addExecutionStep { _, _, _ ->
|
||||||
injector.exEntryPanel.clearCurrentAction()
|
commandLine.clearCurrentAction()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ public class DigraphConsumer : KeyConsumer {
|
|||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
keyProcessResultBuilder.addExecutionStep { _, _, _ ->
|
keyProcessResultBuilder.addExecutionStep { _, _, _ ->
|
||||||
injector.exEntryPanel.clearCurrentAction()
|
commandLine.clearCurrentAction()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user