mirror of
				https://github.com/chylex/IntelliJ-IdeaVim.git
				synced 2025-10-31 11:17:13 +01:00 
			
		
		
		
	Compare commits
	
		
			21 Commits
		
	
	
		
			a7def05aa8
			...
			8de7a9f741
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 8de7a9f741 | |||
| 5977840cef | |||
| d0fea229c4 | |||
| 9eeac4a788 | |||
| 8370661b0d | |||
| 3f88e64abf | |||
| 28e3a7c894 | |||
| bc859c65f5 | |||
| 141fc8ed22 | |||
| dec494639c | |||
| d06688033b | |||
| 98110b9132 | |||
| a0404b8664 | |||
| a2a30d545e | |||
| 4f3bf039c9 | |||
| 1f4b97fa00 | |||
| 61301fdbf5 | |||
| c980250529 | |||
| bdb4b02016 | |||
| 62039a00d3 | |||
| 95c66fd4a6 | 
| @@ -27,8 +27,6 @@ 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 | ||||
|   | ||||
| @@ -458,7 +458,7 @@ val fixVersionsElementType = "VersionBundleElement" | ||||
| tasks.register("releaseActions") { | ||||
|   group = "other" | ||||
|   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()) { | ||||
|       println("Updating statuses for tickets: $tickets") | ||||
|       setYoutrackStatus(tickets, "Fixed") | ||||
|   | ||||
| @@ -13,7 +13,7 @@ ideaVersion=2023.3.3 | ||||
| ideaType=IC | ||||
| downloadIdeaSources=true | ||||
| instrumentPluginCode=true | ||||
| version=chylex-28 | ||||
| version=chylex-27 | ||||
| javaVersion=17 | ||||
| remoteRobotVersion=0.11.22 | ||||
| antlrVersion=4.10.1 | ||||
|   | ||||
| @@ -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.offsetToBufferPosition(woff).column | ||||
|         val col = editor.offsetToVisualPosition(woff).column | ||||
|         val limit = max(0.0, (col + dir * indentConfig.getTotalIndent(count)).toDouble()) | ||||
|           .toInt() | ||||
|         if (col > 0 || soff != eoff) { | ||||
|   | ||||
| @@ -7,8 +7,6 @@ | ||||
|  */ | ||||
| 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 | ||||
| @@ -79,7 +77,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 | ||||
|   | ||||
| @@ -66,9 +66,11 @@ 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 | ||||
| @@ -440,6 +442,8 @@ 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] | ||||
|      */ | ||||
| @@ -488,9 +492,22 @@ internal object VimListenerManager { | ||||
|         IdeaSelectionControl.controlNonVimSelectionChange(editor) | ||||
|       } | ||||
|  | ||||
|       if (document is DocumentEx && document.isInEventsHandling) { | ||||
|       if (myMakingChanges || 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 | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -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, "FUS") | ||||
|     private val GROUP = EventLogGroup("vim.actions", 1) | ||||
|     private val TRACKED_ACTIONS = GROUP.registerEvent( | ||||
|       "tracked", | ||||
|       EventFields.StringValidatedByCustomRule("action_id", ActionRuleValidator::class.java), | ||||
|   | ||||
| @@ -48,7 +48,7 @@ internal class OptionsState : ApplicationUsagesCollector() { | ||||
|   } | ||||
|  | ||||
|   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 IDEAMARKS = BooleanEventField(IjOptions.ideamarks.name) | ||||
|   | ||||
| @@ -31,7 +31,7 @@ internal class PluginState : ApplicationUsagesCollector() { | ||||
|   } | ||||
|  | ||||
|   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 enabledExtensions = HashSet<String>() | ||||
|   | ||||
| @@ -72,7 +72,7 @@ internal class ShortcutConflictState : ApplicationUsagesCollector() { | ||||
|   } | ||||
|  | ||||
|   companion object { | ||||
|     private val GROUP = EventLogGroup("vim.handlers", 1, "FUS") | ||||
|     private val GROUP = EventLogGroup("vim.handlers", 1) | ||||
|  | ||||
|     private val keyStrokes = listOf( | ||||
|       KeyStroke.getKeyStroke('1'.code, CTRL_DOWN_MASK), | ||||
|   | ||||
| @@ -37,7 +37,7 @@ internal class VimscriptState : ApplicationUsagesCollector() { | ||||
|   } | ||||
|  | ||||
|   companion object { | ||||
|     private val GROUP = EventLogGroup("vim.vimscript", 1, "FUS") | ||||
|     private val GROUP = EventLogGroup("vim.vimscript", 1) | ||||
|  | ||||
|     val sourcedFiles = HashSet<String>() | ||||
|     val extensionsEnabledWithPlug = HashSet<String>() | ||||
|   | ||||
| @@ -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="233"/> | ||||
|   <idea-version since-build="232"/> | ||||
|  | ||||
|   <!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform (including CWM) --> | ||||
|   <depends>com.intellij.modules.platform</depends> | ||||
|   | ||||
| @@ -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) | ||||
|     } | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user