diff --git a/src/com/maddyhome/idea/vim/package-info.java b/src/com/maddyhome/idea/vim/package-info.java index 14205f30f..f35963f47 100644 --- a/src/com/maddyhome/idea/vim/package-info.java +++ b/src/com/maddyhome/idea/vim/package-info.java @@ -619,12 +619,12 @@ * |c_CTRL-H| {@link com.maddyhome.idea.vim.ui.ex.DeletePreviousCharAction} * |c_CTRL-I| TO BE IMPLEMENTED * |c_CTRL-J| {@link com.maddyhome.idea.vim.ui.ex.CompleteEntryAction} - * |c_CTRL-K| {@link com.maddyhome.idea.vim.ui.ex.StartDigraphAction} + * |c_CTRL-K| Handled by KeyHandler * |c_CTRL-L| TO BE IMPLEMENTED * |c_CTRL-M| {@link com.maddyhome.idea.vim.action.ex.ProcessExEntryAction} * |c_CTRL-N| {@link com.maddyhome.idea.vim.ui.ex.HistoryDownAction} * |c_CTRL-P| {@link com.maddyhome.idea.vim.ui.ex.HistoryUpAction} - * |c_CTRL-Q| {@link com.maddyhome.idea.vim.ui.ex.StartDigraphAction} + * |c_CTRL-Q| Handled by KeyHandler * |c_CTRL-R| {@link com.maddyhome.idea.vim.ui.ex.InsertRegisterAction} * |c_CTRL-R_CTRL-A| TO BE IMPLEMENTED * |c_CTRL-R_CTRL-F| TO BE IMPLEMENTED @@ -635,7 +635,7 @@ * |c_CTRL-R_CTRL-W| TO BE IMPLEMENTED * |c_CTRL-T| TO BE IMPLEMENTED * |c_CTRL-U| {@link com.maddyhome.idea.vim.ui.ex.DeleteToCursorAction} - * |c_CTRL-V| {@link com.maddyhome.idea.vim.ui.ex.StartDigraphAction} + * |c_CTRL-V| Handled by KeyHandler * |c_CTRL-W| {@link com.maddyhome.idea.vim.ui.ex.DeletePreviousWordAction} * |c_CTRL-Y| TO BE IMPLEMENTED * |c_CTRL-\_e| TO BE IMPLEMENTED diff --git a/src/com/maddyhome/idea/vim/ui/ex/ExActions.kt b/src/com/maddyhome/idea/vim/ui/ex/ExActions.kt index 264876c7e..4e3763fdd 100644 --- a/src/com/maddyhome/idea/vim/ui/ex/ExActions.kt +++ b/src/com/maddyhome/idea/vim/ui/ex/ExActions.kt @@ -290,55 +290,3 @@ class ToggleInsertReplaceAction : TextAction(ExEditorKit.ToggleInsertReplace) { private val logger = logger<ToggleInsertReplaceAction>() } } - -abstract class StartDigraphLiteralActionBase(name: String?) : TextAction(name), MultiStepAction { - private var digraphSequence: DigraphSequence? = null - override fun actionPerformed(e: ActionEvent) { - val target = getTextComponent(e) as ExTextField - val key = ExEditorKit.convert(e) - if (key != null && digraphSequence != null) { - val res = digraphSequence!!.processKey(key, target.editor) - when (res.result) { - DigraphResult.RES_HANDLED -> target.setCurrentActionPromptCharacter(res.promptCharacter) - DigraphResult.RES_BAD -> { - target.clearCurrentAction() - // Eat the character, unless it's <C-C>, in which case, forward on and cancel entry. Note that at some point - // we should support input of control characters - if (key.modifiers and KeyEvent.CTRL_DOWN_MASK != 0 && key.keyCode == KeyEvent.VK_C) { - target.handleKey(key) - } - } - DigraphResult.RES_DONE -> { - val digraph = res.stroke - digraphSequence = null - target.clearCurrentAction() - if (digraph != null) { - target.handleKey(digraph) - } - } - } - } else if (key != null) { - digraphSequence = DigraphSequence() - val res = start(digraphSequence!!) - target.setCurrentAction(this, res.promptCharacter) - } - } - - protected abstract fun start(digraphSequence: DigraphSequence): DigraphResult - - override fun reset() { - digraphSequence = null - } -} - -class StartDigraphAction : StartDigraphLiteralActionBase(ExEditorKit.StartDigraph) { - override fun start(digraphSequence: DigraphSequence): DigraphResult { - return digraphSequence.startDigraphSequence() - } -} - -class StartLiteralAction : StartDigraphLiteralActionBase(ExEditorKit.StartLiteral) { - override fun start(digraphSequence: DigraphSequence): DigraphResult { - return digraphSequence.startLiteralSequence() - } -} diff --git a/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt b/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt index 881c4cb9b..181d744c3 100644 --- a/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt +++ b/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt @@ -78,8 +78,6 @@ object ExEditorKit : DefaultEditorKit() { HistoryUpFilterAction(), HistoryDownFilterAction(), ToggleInsertReplaceAction(), - StartDigraphAction(), - StartLiteralAction(), InsertRegisterAction() )