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

Compare commits

..

29 Commits

Author SHA1 Message Date
a7def05aa8
Set plugin version to chylex-28 2024-02-18 18:49:31 +01:00
51e13a5f20
Disable speed search in Project tool window when NERDTree is enabled 2024-02-18 18:49:16 +01:00
9b67260d5a
Work around VIM-3306 (make paragraph-motion plugin go to the end of the line) 2024-02-18 18:49:16 +01:00
ac37432db6
Apply scrolloff after executing native IDEA actions 2024-02-18 18:49:16 +01:00
4c946568e4
Stay on same line after reindenting 2024-02-18 18:49:16 +01:00
7e70eed1ab
Implement motions to go to next/previous misspelled word 2024-02-18 18:49:16 +01:00
43ae90044b
Update search register when using f/t 2024-02-18 18:49:16 +01:00
d79f7c23c5
Automatically add unambiguous imports after running a macro 2024-02-18 18:49:15 +01:00
6033450158
Fix(VIM-3179): Respect virtual space below editor (imperfectly) 2024-02-18 18:49:15 +01:00
ea86d7132c
Fix(VIM-3178): Workaround to support "Jump to Source" action mapping 2024-02-18 18:49:15 +01:00
711d1f0329
Fix(VIM-3166): Workaround to fix broken filtering of visual lines 2024-02-18 18:49:15 +01:00
338e137347
Add support for count for visual and line motion surround 2024-02-18 18:49:15 +01:00
2b0e9bfec5
Fix vim-surround not working with multiple cursors
Fixes multiple cursors with vim-surround commands `cs, ds, S` (but not `ys`).
2024-02-18 18:49:15 +01:00
b42346b9e1
Fix(VIM-696) Restore visual mode after undo/redo, and disable incompatible actions 2024-02-18 18:49:15 +01:00
d58d3ca8b0
Revert(VIM-2884): Fix moving lines to cursor 2024-02-18 18:49:15 +01:00
22b2ca2352
Respect count with <Action> mappings 2024-02-18 18:49:15 +01:00
1c98daa180
Add Matchit support for Java statements 2024-02-18 18:49:15 +01:00
de906bcbac
Change matchit plugin to use HTML patterns in unrecognized files 2024-02-18 18:49:14 +01:00
05fac8bf00
Reset insert mode when switching active editor 2024-02-18 18:49:14 +01:00
a985d260f7
Remove update checker 2024-02-18 18:49:14 +01:00
9f4c679d77
Set custom plugin version 2024-02-18 18:49:14 +01:00
IdeaVim Bot
f4cf06a50e Update changelog. Action id - 7940923443 2024-02-17 10:05:47 +00:00
Alex Plate
86bf8dcc60
Fix the compatibility with platform 2024-02-17 08:56:17 +02:00
Alex Plate
d37898b6d3
Fix(VIM-3234): The space character won't mix in the tab chars after >> and << commands
Because of some reason, the visual position function from the platform starts to return an incorrect column for offsets with tabs. Maybe this is a correct behaviour for the platform, but for IdeaVim it breaks the calculation of the current caret position.

The visual position for calculating the shift was used since 2003, but there is no specific reason to use it and not the buffer (logical) position. So, since it started to cause issues, it's replaced with the buffer position.
2024-02-17 08:54:42 +02:00
Alex Plate
1edd6a9002
Fix the compatibility with the new version of the platform 2024-02-17 08:15:11 +02:00
Alex Plate
f7fa0dcbd1
Update YouTrack query for updating the release status after the release 2024-02-17 08:15:11 +02:00
Alex Plate
4f0a95a803
Bring back setCompletionPhase as this incompatibility was fixed in the latest EAP of the IntelliJ platform 2024-02-17 08:15:11 +02:00
IdeaVim Bot
e443cb0d3c Update changelog. Action id - 7928973613 2024-02-16 10:06:24 +00:00
Alex Plate
6fa228ee08
Fix(VIM-3291): Remove sync of editor selection between different opened editors
This is an old feature implemented by Rick Maddy in 2004, taken from Vim.
 c294063223

 If several buffers for the same file are opened, the selection is synchronized between buffers.
This doesn't happen in IJ natively and I don't see a reason to keep it like that.
This behaviour is removed because it causes issues now, but if we'll figure out the usage, we can bring it back.
2024-02-15 20:34:57 +02:00
13 changed files with 67 additions and 28 deletions

View File

@ -27,6 +27,8 @@ usual beta standards.
### Fixes:
* [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:
* [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") {
group = "other"
doLast {
val tickets = getYoutrackTicketsByQuery("%23%7BReady+To+Release%7D")
val tickets = getYoutrackTicketsByQuery("%23%7BReady+To+Release%7D%20and%20tag:%20%7BIdeaVim%20Released%20In%20EAP%7D%20")
if (tickets.isNotEmpty()) {
println("Updating statuses for tickets: $tickets")
setYoutrackStatus(tickets, "Fixed")

View File

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

View File

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

View File

@ -7,6 +7,8 @@
*/
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.diagnostic.logger
import com.intellij.openapi.progress.ProcessCanceledException
@ -77,7 +79,7 @@ internal class MacroGroup : VimMacroBase() {
ProgressManager.getInstance().executeNonCancelableSection {
// Prevent autocompletion during macros.
// See https://github.com/JetBrains/ideavim/pull/772 for details
// CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion)
CompletionServiceImpl.setCompletionPhase(CompletionPhase.NoCompletion)
getInstance().handleKey(editor, key, context)
}
if (injector.messages.isError()) return@runnable

View File

@ -66,11 +66,9 @@ import com.maddyhome.idea.vim.group.IjOptions
import com.maddyhome.idea.vim.group.MotionGroup
import com.maddyhome.idea.vim.group.OptionGroup
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.VimVisualTimer
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.keyCheckRequests
import com.maddyhome.idea.vim.helper.GuicursorChangeListener
@ -442,8 +440,6 @@ internal object VimListenerManager {
}
private object EditorSelectionHandler : SelectionListener {
private var myMakingChanges = false
/**
* This event is executed for each caret using [com.intellij.openapi.editor.CaretModel.runForEachCaret]
*/
@ -492,22 +488,9 @@ internal object VimListenerManager {
IdeaSelectionControl.controlNonVimSelectionChange(editor)
}
if (myMakingChanges || document is DocumentEx && document.isInEventsHandling) {
if (document is DocumentEx && document.isInEventsHandling) {
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() {
companion object {
private val GROUP = EventLogGroup("vim.actions", 1)
private val GROUP = EventLogGroup("vim.actions", 1, "FUS")
private val TRACKED_ACTIONS = GROUP.registerEvent(
"tracked",
EventFields.StringValidatedByCustomRule("action_id", ActionRuleValidator::class.java),

View File

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

View File

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

View File

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

View File

@ -37,7 +37,7 @@ internal class VimscriptState : ApplicationUsagesCollector() {
}
companion object {
private val GROUP = EventLogGroup("vim.vimscript", 1)
private val GROUP = EventLogGroup("vim.vimscript", 1, "FUS")
val sourcedFiles = 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 -->
<!-- Check for [Version Update] tag in YouTrack as well -->
<!-- Also, please update the value in build.gradle.kts file-->
<idea-version since-build="232"/>
<idea-version since-build="233"/>
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform (including CWM) -->
<depends>com.intellij.modules.platform</depends>

View File

@ -0,0 +1,52 @@
/*
* 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)
}
}
}