1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2024-11-25 16:42:55 +01:00

Compare commits

..

16 Commits

Author SHA1 Message Date
1afd0d3c37
Set plugin version to chylex-18 2023-10-20 00:58:13 +02:00
547bd08c7e
Set minimum IDEA version to 2023.2 2023-10-20 00:58:13 +02:00
0c4154547f
Reset insert mode when switching active editor 2023-10-20 00:58:12 +02:00
92d8be1ba4
Revert "Add VimScript 'renaming()' function"
This reverts commit a8a822b58e.
2023-10-20 00:58:12 +02:00
080dbe9c0e
Prevent IdeaVIM from stealing key binding that confirms in-place refactoring 2023-10-20 00:58:12 +02:00
ff7e6bf053
Set plugin version to chylex-17 2023-10-19 06:13:47 +02:00
f19ce34311
Add operating system type to has() function 2023-10-18 22:14:42 +02:00
8bcb0d116d
Set plugin version to chylex-16 2023-09-29 01:39:49 +02:00
d9ae9fa40d
Remove update checker 2023-09-29 01:39:48 +02:00
c19f88e5c0
[VIM-696] Restore visual mode after undo/redo, and disable incompatible actions 2023-09-29 01:39:48 +02:00
03f4fb288d
Change matchit plugin to use HTML patterns in unrecognized files 2023-09-29 01:39:48 +02:00
ef27579277
Fix vim-surround not working with multiple cursors
Fixes multiple cursors with vim-surround commands `cs, ds, S` (but not `ys`).
2023-09-29 01:39:48 +02:00
a8a822b58e
Add VimScript 'renaming()' function 2023-09-29 01:39:48 +02:00
9752bd5bbb
Add support for repeatable actions with ':raction' 2023-09-29 01:39:48 +02:00
240d9e0be4
Disable taking over arrow keys and Home/End 2023-09-29 01:39:48 +02:00
328442544d
Set custom plugin version 2023-09-29 01:39:48 +02:00
4 changed files with 8 additions and 18 deletions

View File

@ -11,7 +11,7 @@
ideaVersion=2023.2
downloadIdeaSources=true
instrumentPluginCode=true
version=chylex-1
version=chylex-18
javaVersion=17
remoteRobotVersion=0.11.17
antlrVersion=4.10.1

View File

@ -164,6 +164,10 @@ internal class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatib
return ActionEnableStatus.no("App code template is active", LogLevel.INFO)
}
if (keyCode == KeyEvent.VK_LEFT || keyCode == KeyEvent.VK_RIGHT || keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN || keyCode == KeyEvent.VK_HOME || keyCode == KeyEvent.VK_END) {
return ActionEnableStatus.no("Special keys", LogLevel.INFO)
}
val nextTemplateVariableShortcuts = KeymapManager.getInstance().activeKeymap.getShortcuts(IdeActions.ACTION_EDITOR_NEXT_TEMPLATE_VARIABLE)
if (nextTemplateVariableShortcuts.any { it is KeyboardShortcut && it.firstKeyStroke == keyStroke }) {
val handler = EditorActionManager.getInstance().getActionHandler(IdeActions.ACTION_EDITOR_NEXT_TEMPLATE_VARIABLE)

View File

@ -18,12 +18,12 @@ import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.editor.Document
import com.intellij.openapi.editor.toolbar.floating.AbstractFloatingToolbarProvider
import com.intellij.openapi.editor.toolbar.floating.FloatingToolbarComponent
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil
import com.maddyhome.idea.vim.api.VimrcFileState
import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.extension.VimExtensionRegistrar
import com.maddyhome.idea.vim.helper.MessageHelper
import com.maddyhome.idea.vim.icons.VimIcons
import com.maddyhome.idea.vim.key.MappingOwner
@ -149,14 +149,12 @@ internal class ReloadVimRc : DumbAwareAction() {
override fun actionPerformed(e: AnActionEvent) {
val editor = e.getData(PlatformDataKeys.EDITOR) ?: return
FileDocumentManager.getInstance().saveDocumentAsIs(editor.document)
injector.keyGroup.removeKeyMapping(MappingOwner.IdeaVim.InitScript)
Troubleshooter.instance.removeByType("old-action-notation-in-mappings")
// Reload the ideavimrc in the context of the current window, as though we had called `:source ~/.ideavimrc`
executeIdeaVimRc(editor.vim)
// Ensure newly added extensions are initialized
VimExtensionRegistrar.enableDelayedExtensions()
}
}

View File

@ -11,8 +11,6 @@ package com.maddyhome.idea.vim.vimscript
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.components.Service
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.vfs.VirtualFileManager
import com.maddyhome.idea.vim.VimPlugin
import com.maddyhome.idea.vim.api.ExecutionContext
import com.maddyhome.idea.vim.api.VimEditor
@ -90,22 +88,12 @@ internal class Executor : VimScriptExecutorBase() {
override fun executeFile(file: File, editor: VimEditor, indicateErrors: Boolean) {
val context = DataContext.EMPTY_CONTEXT.vim
try {
ensureFileIsSaved(file)
execute(file.readText(), editor, context, skipHistory = true, indicateErrors)
} catch (ignored: IOException) {
LOG.error(ignored)
}
}
private fun ensureFileIsSaved(file: File) {
val documentManager = FileDocumentManager.getInstance()
VirtualFileManager.getInstance().findFileByNioPath(file.toPath())
?.let(documentManager::getCachedDocument)
?.takeIf(documentManager::isDocumentUnsaved)
?.let(documentManager::saveDocumentAsIs)
}
@Throws(ExException::class)
override fun executeLastCommand(editor: VimEditor, context: ExecutionContext): Boolean {
val reg = VimPlugin.getRegister().getRegister(':') ?: return false