mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2026-10-16 20:33:57 +02:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9b8a4fb13
|
||
|
|
75bfa61925
|
||
|
|
200ec346d0
|
||
|
|
372a105edc
|
||
|
|
898c8f5fab
|
||
|
|
a772fd0b05
|
||
|
|
6c4c4d1050
|
||
|
|
b28c2690e7
|
+1
-1
@@ -18,7 +18,7 @@ ideaVersion=2026.1
|
||||
# Values for type: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension-type
|
||||
ideaType=IU
|
||||
instrumentPluginCode=true
|
||||
version=9999.60-chylex
|
||||
version=9999.61-chylex
|
||||
javaVersion=21
|
||||
remoteRobotVersion=0.11.23
|
||||
antlrVersion=4.10.1
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.vimscript.model.functions.handlers
|
||||
|
||||
import com.intellij.refactoring.rename.inplace.InplaceRefactoring
|
||||
import com.intellij.vim.annotations.VimscriptFunction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
import com.maddyhome.idea.vim.vimscript.model.VimLContext
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt
|
||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.asVimInt
|
||||
import com.maddyhome.idea.vim.vimscript.model.functions.BuiltinFunctionHandler
|
||||
|
||||
@VimscriptFunction(name = "isinplacerenaming")
|
||||
internal class IsInPlaceRenaming : BuiltinFunctionHandler<VimInt>() {
|
||||
override fun doFunction(arguments: Arguments, editor: VimEditor, context: ExecutionContext, vimContext: VimLContext) =
|
||||
(InplaceRefactoring.getActiveInplaceRenamer(editor.ij) != null).asVimInt()
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"has": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.HasFunctionHandler",
|
||||
"isactionenabled": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.IsActionEnabled",
|
||||
"isinplacerenaming": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.IsInPlaceRenaming",
|
||||
"pumvisible": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.PopupMenuVisibleFunctionHandler"
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import com.maddyhome.idea.vim.helper.CharacterHelper.charType
|
||||
import com.maddyhome.idea.vim.helper.NumberType
|
||||
import com.maddyhome.idea.vim.helper.StrictMode
|
||||
import com.maddyhome.idea.vim.helper.endOffsetInclusive
|
||||
import com.maddyhome.idea.vim.helper.isCaretAtLineEnd
|
||||
import com.maddyhome.idea.vim.helper.usesVirtualSpace
|
||||
import com.maddyhome.idea.vim.key.AbbreviationContext
|
||||
import com.maddyhome.idea.vim.key.findAndResolveAbbreviation
|
||||
@@ -388,7 +389,7 @@ abstract class VimChangeGroupBase : VimChangeGroup {
|
||||
caret.moveToOffset(position)
|
||||
} else {
|
||||
repeatInsertText(editor, context, count)
|
||||
if (!(editor.charAt(caret.offset) == '\n' && editor.charAt(caret.offset - 1).let { it == ' ' || it == '\t' })) {
|
||||
if (!(editor.isCaretAtLineEnd(caret, true) && editor.charAt(caret.offset - 1).let { it == ' ' || it == '\t' })) {
|
||||
val position = injector.motion.getHorizontalMotion(editor, caret, -1, false)
|
||||
caret.moveToMotion(position)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user