1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-11-04 01:40:12 +01:00

Compare commits

...

2 Commits

Author SHA1 Message Date
c9eb104a45 Set plugin version to chylex-25 2024-01-27 06:20:22 +01:00
ade53624cc Apply scrolloff after executing native IDEA actions 2024-01-27 06:12:04 +01:00
2 changed files with 33 additions and 28 deletions

View File

@@ -11,7 +11,7 @@
ideaVersion=2023.3.2
downloadIdeaSources=true
instrumentPluginCode=true
version=chylex-1
version=chylex-25
javaVersion=17
remoteRobotVersion=0.11.21
antlrVersion=4.10.1

View File

@@ -34,6 +34,7 @@ import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.action.VimShortcutKeyAction
import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.group.NotificationService
import com.maddyhome.idea.vim.helper.EditorHelper
import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere
import com.maddyhome.idea.vim.helper.vimStateMachine
import com.maddyhome.idea.vim.newapi.globalIjOptions
@@ -95,7 +96,8 @@ internal object IdeaSpecifics {
if (VimPlugin.isNotEnabled()) return
val editor = editor
if (editor != null && action is ChooseItemAction && editor.vimStateMachine?.isRecording == true) {
if (editor != null) {
if (action is ChooseItemAction && editor.vimStateMachine?.isRecording == true) {
val prevDocumentLength = completionPrevDocumentLength
val prevDocumentOffset = completionPrevDocumentOffset
@@ -122,15 +124,18 @@ internal object IdeaSpecifics {
)
}
) {
editor?.let {
val commandState = it.vim.vimStateMachine
val commandState = editor.vim.vimStateMachine
commandState.mode = Mode.NORMAL()
VimPlugin.getChange().insertBeforeCursor(it.vim, event.dataContext.vim)
KeyHandler.getInstance().reset(it.vim)
}
VimPlugin.getChange().insertBeforeCursor(editor.vim, event.dataContext.vim)
KeyHandler.getInstance().reset(editor.vim)
}
//endregion
if (EditorHelper.getVisibleArea(editor).let { it.width > 0 && it.height > 0 }) {
injector.scroll.scrollCaretIntoView(editor.vim)
}
}
this.editor = null
}
}