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

Compare commits

..

21 Commits

Author SHA1 Message Date
8de7a9f741
Set plugin version to chylex-27 2024-02-16 06:09:40 +01:00
5977840cef
Disable speed search in Project tool window when NERDTree is enabled 2024-02-16 06:09:40 +01:00
d0fea229c4
Work around VIM-3306 (make paragraph-motion plugin go to the end of the line) 2024-02-16 06:09:40 +01:00
9eeac4a788
Apply scrolloff after executing native IDEA actions 2024-02-16 06:09:40 +01:00
8370661b0d
Stay on same line after reindenting 2024-02-16 06:09:40 +01:00
3f88e64abf
Implement motions to go to next/previous misspelled word 2024-02-16 06:09:39 +01:00
28e3a7c894
Update search register when using f/t 2024-02-16 06:09:39 +01:00
bc859c65f5
Automatically add unambiguous imports after running a macro 2024-02-16 06:09:39 +01:00
141fc8ed22
Fix(VIM-3179): Respect virtual space below editor (imperfectly) 2024-02-16 06:09:39 +01:00
dec494639c
Fix(VIM-3178): Workaround to support "Jump to Source" action mapping 2024-02-16 06:09:39 +01:00
d06688033b
Fix(VIM-3166): Workaround to fix broken filtering of visual lines 2024-02-16 06:09:39 +01:00
98110b9132
Add support for count for visual and line motion surround 2024-02-16 06:09:39 +01:00
a0404b8664
Fix vim-surround not working with multiple cursors
Fixes multiple cursors with vim-surround commands `cs, ds, S` (but not `ys`).
2024-02-16 06:09:39 +01:00
a2a30d545e
Fix(VIM-696) Restore visual mode after undo/redo, and disable incompatible actions 2024-02-16 06:09:38 +01:00
4f3bf039c9
Revert(VIM-2884): Fix moving lines to cursor 2024-02-15 08:30:02 +01:00
1f4b97fa00
Respect count with <Action> mappings 2024-02-15 08:30:02 +01:00
61301fdbf5
Add Matchit support for Java statements 2024-02-15 08:30:02 +01:00
c980250529
Change matchit plugin to use HTML patterns in unrecognized files 2024-02-15 08:30:02 +01:00
bdb4b02016
Reset insert mode when switching active editor 2024-02-15 08:30:02 +01:00
62039a00d3
Remove update checker 2024-02-15 08:30:02 +01:00
95c66fd4a6
Set custom plugin version 2024-02-15 08:30:01 +01:00
13 changed files with 28 additions and 67 deletions

View File

@ -27,8 +27,6 @@ usual beta standards.
### Fixes: ### Fixes:
* [VIM-3055](https://youtrack.jetbrains.com/issue/VIM-3055) Fix the issue with double deleting after dot * [VIM-3055](https://youtrack.jetbrains.com/issue/VIM-3055) Fix the issue with double deleting after dot
* [VIM-3291](https://youtrack.jetbrains.com/issue/VIM-3291) Remove sync of editor selection between different opened editors
* [VIM-3234](https://youtrack.jetbrains.com/issue/VIM-3234) The space character won't mix in the tab chars after >> and << commands
### Merged PRs: ### Merged PRs:
* [725](https://github.com/JetBrains/ideavim/pull/725) by [Emanuel Gestosa](https://github.com/emanuelgestosa): Regex * [725](https://github.com/JetBrains/ideavim/pull/725) by [Emanuel Gestosa](https://github.com/emanuelgestosa): Regex

View File

@ -458,7 +458,7 @@ val fixVersionsElementType = "VersionBundleElement"
tasks.register("releaseActions") { tasks.register("releaseActions") {
group = "other" group = "other"
doLast { doLast {
val tickets = getYoutrackTicketsByQuery("%23%7BReady+To+Release%7D%20and%20tag:%20%7BIdeaVim%20Released%20In%20EAP%7D%20") val tickets = getYoutrackTicketsByQuery("%23%7BReady+To+Release%7D")
if (tickets.isNotEmpty()) { if (tickets.isNotEmpty()) {
println("Updating statuses for tickets: $tickets") println("Updating statuses for tickets: $tickets")
setYoutrackStatus(tickets, "Fixed") setYoutrackStatus(tickets, "Fixed")

View File

@ -13,7 +13,7 @@ ideaVersion=2023.3.3
ideaType=IC ideaType=IC
downloadIdeaSources=true downloadIdeaSources=true
instrumentPluginCode=true instrumentPluginCode=true
version=chylex-28 version=chylex-27
javaVersion=17 javaVersion=17
remoteRobotVersion=0.11.22 remoteRobotVersion=0.11.22
antlrVersion=4.10.1 antlrVersion=4.10.1

View File

@ -531,7 +531,7 @@ public class ChangeGroup : VimChangeGroupBase() {
val soff = editor.getLineStartOffset(l) val soff = editor.getLineStartOffset(l)
val eoff = editor.getLineEndOffset(l, true) val eoff = editor.getLineEndOffset(l, true)
val woff = injector.motion.moveCaretToLineStartSkipLeading(editor, l) val woff = injector.motion.moveCaretToLineStartSkipLeading(editor, l)
val col = editor.offsetToBufferPosition(woff).column val col = editor.offsetToVisualPosition(woff).column
val limit = max(0.0, (col + dir * indentConfig.getTotalIndent(count)).toDouble()) val limit = max(0.0, (col + dir * indentConfig.getTotalIndent(count)).toDouble())
.toInt() .toInt()
if (col > 0 || soff != eoff) { if (col > 0 || soff != eoff) {

View File

@ -7,8 +7,6 @@
*/ */
package com.maddyhome.idea.vim.group package com.maddyhome.idea.vim.group
import com.intellij.codeInsight.completion.CompletionPhase
import com.intellij.codeInsight.completion.impl.CompletionServiceImpl
import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.diagnostic.logger import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.progress.ProcessCanceledException
@ -79,7 +77,7 @@ internal class MacroGroup : VimMacroBase() {
ProgressManager.getInstance().executeNonCancelableSection { ProgressManager.getInstance().executeNonCancelableSection {
// Prevent autocompletion during macros. // Prevent autocompletion during macros.
// See https://github.com/JetBrains/ideavim/pull/772 for details // See https://github.com/JetBrains/ideavim/pull/772 for details
CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion) // CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion)
getInstance().handleKey(editor, key, context) getInstance().handleKey(editor, key, context)
} }
if (injector.messages.isError()) return@runnable if (injector.messages.isError()) return@runnable

View File

@ -66,9 +66,11 @@ import com.maddyhome.idea.vim.group.IjOptions
import com.maddyhome.idea.vim.group.MotionGroup import com.maddyhome.idea.vim.group.MotionGroup
import com.maddyhome.idea.vim.group.OptionGroup import com.maddyhome.idea.vim.group.OptionGroup
import com.maddyhome.idea.vim.group.ScrollGroup import com.maddyhome.idea.vim.group.ScrollGroup
import com.maddyhome.idea.vim.group.SearchGroup
import com.maddyhome.idea.vim.group.visual.IdeaSelectionControl import com.maddyhome.idea.vim.group.visual.IdeaSelectionControl
import com.maddyhome.idea.vim.group.visual.VimVisualTimer import com.maddyhome.idea.vim.group.visual.VimVisualTimer
import com.maddyhome.idea.vim.group.visual.moveCaretOneCharLeftFromSelectionEnd import com.maddyhome.idea.vim.group.visual.moveCaretOneCharLeftFromSelectionEnd
import com.maddyhome.idea.vim.group.visual.vimSetSystemSelectionSilently
import com.maddyhome.idea.vim.handler.correctorRequester import com.maddyhome.idea.vim.handler.correctorRequester
import com.maddyhome.idea.vim.handler.keyCheckRequests import com.maddyhome.idea.vim.handler.keyCheckRequests
import com.maddyhome.idea.vim.helper.GuicursorChangeListener import com.maddyhome.idea.vim.helper.GuicursorChangeListener
@ -440,6 +442,8 @@ internal object VimListenerManager {
} }
private object EditorSelectionHandler : SelectionListener { private object EditorSelectionHandler : SelectionListener {
private var myMakingChanges = false
/** /**
* This event is executed for each caret using [com.intellij.openapi.editor.CaretModel.runForEachCaret] * This event is executed for each caret using [com.intellij.openapi.editor.CaretModel.runForEachCaret]
*/ */
@ -488,9 +492,22 @@ internal object VimListenerManager {
IdeaSelectionControl.controlNonVimSelectionChange(editor) IdeaSelectionControl.controlNonVimSelectionChange(editor)
} }
if (document is DocumentEx && document.isInEventsHandling) { if (myMakingChanges || document is DocumentEx && document.isInEventsHandling) {
return return
} }
myMakingChanges = true
try {
// Synchronize selections between editors
val newRange = selectionEvent.newRange
for (e in localEditors(document)) {
if (e != editor) {
e.selectionModel.vimSetSystemSelectionSilently(newRange.startOffset, newRange.endOffset)
}
}
} finally {
myMakingChanges = false
}
} }
} }

View File

@ -15,7 +15,7 @@ import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesColle
internal class ActionTracker : CounterUsagesCollector() { internal class ActionTracker : CounterUsagesCollector() {
companion object { companion object {
private val GROUP = EventLogGroup("vim.actions", 1, "FUS") private val GROUP = EventLogGroup("vim.actions", 1)
private val TRACKED_ACTIONS = GROUP.registerEvent( private val TRACKED_ACTIONS = GROUP.registerEvent(
"tracked", "tracked",
EventFields.StringValidatedByCustomRule("action_id", ActionRuleValidator::class.java), EventFields.StringValidatedByCustomRule("action_id", ActionRuleValidator::class.java),

View File

@ -48,7 +48,7 @@ internal class OptionsState : ApplicationUsagesCollector() {
} }
companion object { companion object {
private val GROUP = EventLogGroup("vim.options", 1, "FUS") private val GROUP = EventLogGroup("vim.options", 1)
private val IDEAJOIN = BooleanEventField(IjOptions.ideajoin.name) private val IDEAJOIN = BooleanEventField(IjOptions.ideajoin.name)
private val IDEAMARKS = BooleanEventField(IjOptions.ideamarks.name) private val IDEAMARKS = BooleanEventField(IjOptions.ideamarks.name)

View File

@ -31,7 +31,7 @@ internal class PluginState : ApplicationUsagesCollector() {
} }
companion object { companion object {
private val GROUP = EventLogGroup("vim.common", 1, "FUS") private val GROUP = EventLogGroup("vim.common", 1)
val extensionNames = listOf("textobj-entire", "argtextobj", "ReplaceWithRegister", "vim-paragraph-motion", "highlightedyank", "multiple-cursors", "exchange", "NERDTree", "surround", "commentary", "matchit", "textobj-indent") val extensionNames = listOf("textobj-entire", "argtextobj", "ReplaceWithRegister", "vim-paragraph-motion", "highlightedyank", "multiple-cursors", "exchange", "NERDTree", "surround", "commentary", "matchit", "textobj-indent")
val enabledExtensions = HashSet<String>() val enabledExtensions = HashSet<String>()

View File

@ -72,7 +72,7 @@ internal class ShortcutConflictState : ApplicationUsagesCollector() {
} }
companion object { companion object {
private val GROUP = EventLogGroup("vim.handlers", 1, "FUS") private val GROUP = EventLogGroup("vim.handlers", 1)
private val keyStrokes = listOf( private val keyStrokes = listOf(
KeyStroke.getKeyStroke('1'.code, CTRL_DOWN_MASK), KeyStroke.getKeyStroke('1'.code, CTRL_DOWN_MASK),

View File

@ -37,7 +37,7 @@ internal class VimscriptState : ApplicationUsagesCollector() {
} }
companion object { companion object {
private val GROUP = EventLogGroup("vim.vimscript", 1, "FUS") private val GROUP = EventLogGroup("vim.vimscript", 1)
val sourcedFiles = HashSet<String>() val sourcedFiles = HashSet<String>()
val extensionsEnabledWithPlug = HashSet<String>() val extensionsEnabledWithPlug = HashSet<String>()

View File

@ -19,7 +19,7 @@
<!-- Please search for "[VERSION UPDATE]" in project in case you update the since-build version --> <!-- Please search for "[VERSION UPDATE]" in project in case you update the since-build version -->
<!-- Check for [Version Update] tag in YouTrack as well --> <!-- Check for [Version Update] tag in YouTrack as well -->
<!-- Also, please update the value in build.gradle.kts file--> <!-- Also, please update the value in build.gradle.kts file-->
<idea-version since-build="233"/> <idea-version since-build="232"/>
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform (including CWM) --> <!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform (including CWM) -->
<depends>com.intellij.modules.platform</depends> <depends>com.intellij.modules.platform</depends>

View File

@ -1,52 +0,0 @@
/*
* Copyright 2003-2024 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 org.jetbrains.plugins.ideavim.action.change.shift
import com.intellij.application.options.CodeStyle
import com.intellij.ide.highlighter.JavaFileType
import org.jetbrains.plugins.ideavim.SkipNeovimReason
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
import org.jetbrains.plugins.ideavim.VimJavaTestCase
import org.junit.jupiter.api.Test
class ShiftRightLinesActionTest : VimJavaTestCase() {
@TestWithoutNeovim(SkipNeovimReason.NOT_VIM_TESTING)
@Test
fun `add indent for java file`() {
val before = """
|public class C {
|.I${c}nteger a;
|}
""".trimMargin().dotToTab()
val after = """
|public class C {
|.....Integer a;
|}
""".trimMargin().dotToTab()
usingTabs {
configureByJavaText(before)
typeText(">>".repeat(4))
assertState(after)
}
}
private fun usingTabs(action: () -> Unit) {
val testSettings = CodeStyle.createTestSettings()
val javaSettings = testSettings.getIndentOptions(JavaFileType.INSTANCE)
javaSettings.USE_TAB_CHARACTER = true
CodeStyle.setTemporarySettings(fixture.project, testSettings)
try {
action()
} finally {
CodeStyle.dropTemporarySettings(fixture.project)
}
}
}