From 2139e31754284a9a3b2f2da6315f1ab45752bc08 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Tue, 4 May 2021 14:51:19 +0300 Subject: [PATCH 01/34] Add help lines for the table --- resources/messages/IdeaVimBundle.properties | 2 +- .../idea/vim/ui/VimEmulationConfigurable.java | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/resources/messages/IdeaVimBundle.properties b/resources/messages/IdeaVimBundle.properties index b327ccca95..9c18e285f1 100644 --- a/resources/messages/IdeaVimBundle.properties +++ b/resources/messages/IdeaVimBundle.properties @@ -128,7 +128,7 @@ action.finish.eap.text=Finish EAP action.subscribe.to.eap.text=Subscribe to EAP configurable.name.vim.emulation=Vim Emulation -configurable.noneditablehandler.helper.text=Non editable handlers are defined in .ideavimrc file +configurable.keyhandler.link=Use sethandler command to configure handlers from the .ideavimrc file configurable.noneditablehandler.helper.text.with.example=Non editable handlers are defined in .ideavimrc file. E.g. ''{0}'' for {1}. border.title.shortcut.conflicts.for.active.keymap=Shortcut Conflicts for Active Keymap message.no.more.matches=No more matches diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index 6bf7d56a8b..4d870c15b8 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -26,10 +26,7 @@ import com.intellij.openapi.options.Configurable; import com.intellij.openapi.ui.ComboBoxTableRenderer; import com.intellij.openapi.ui.StripeTable; -import com.intellij.ui.DumbAwareActionButton; -import com.intellij.ui.IdeBorderFactory; -import com.intellij.ui.JBColor; -import com.intellij.ui.ToolbarDecorator; +import com.intellij.ui.*; import com.intellij.ui.components.JBLabel; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.UIUtil; @@ -117,17 +114,21 @@ public void addHelpLine(VimShortcutConflictsTable.Model model) { ShortcutOwnerInfo owner = row.getOwner(); return owner instanceof ShortcutOwnerInfo.PerMode; }); - JBLabel helpLine = new JBLabel(); if (firstPerMode == null) { - helpLine.setText(MessageHelper.message("configurable.noneditablehandler.helper.text")); + HyperlinkLabel label = new HyperlinkLabel(); + label.setTextWithHyperlink(MessageHelper.message("configurable.keyhandler.link")); + label.setHyperlinkTarget("https://jb.gg/abva4t"); + label.setForeground(UIUtil.getInactiveTextColor()); + add(label, BorderLayout.SOUTH); } else { + JBLabel helpLine = new JBLabel(); helpLine.setText(MessageHelper.message("configurable.noneditablehandler.helper.text.with.example", ((ShortcutOwnerInfo.PerMode)firstPerMode.myOwner).toNotation(), KeymapUtil.getShortcutText(new KeyboardShortcut(firstPerMode.getKeyStroke(), null)))); + helpLine.setForeground(UIUtil.getInactiveTextColor()); + add(helpLine, BorderLayout.SOUTH); } - helpLine.setForeground(UIUtil.getInactiveTextColor()); - add(helpLine, BorderLayout.SOUTH); } } From 66b2fee8233ef2d30fd6decf43a55d741364b460 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Tue, 4 May 2021 15:42:12 +0300 Subject: [PATCH 02/34] Add .ideavimrc to dic --- resources/dictionaries/ideavim.dic | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/dictionaries/ideavim.dic b/resources/dictionaries/ideavim.dic index 726face543..2cadf89b35 100644 --- a/resources/dictionaries/ideavim.dic +++ b/resources/dictionaries/ideavim.dic @@ -1,4 +1,5 @@ ideavim +ideavimrc gdefault From 85aae4d4083dd6152ea00dd1e79632be49c66332 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Tue, 11 May 2021 10:54:20 +0300 Subject: [PATCH 03/34] Fix issues with Track action IDs notification --- resources/messages/IdeaVimBundle.properties | 2 ++ .../idea/vim/group/NotificationService.kt | 5 ++++- .../maddyhome/idea/vim/listener/IdeaSpecifics.kt | 16 +++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/resources/messages/IdeaVimBundle.properties b/resources/messages/IdeaVimBundle.properties index 9c18e285f1..9c069a41c4 100644 --- a/resources/messages/IdeaVimBundle.properties +++ b/resources/messages/IdeaVimBundle.properties @@ -133,3 +133,5 @@ configurable.noneditablehandler.helper.text.with.example=Non editable handlers a border.title.shortcut.conflicts.for.active.keymap=Shortcut Conflicts for Active Keymap message.no.more.matches=No more matches E223=E223: recursive mapping + +action.copy.action.id.text=Copy Action Id diff --git a/src/com/maddyhome/idea/vim/group/NotificationService.kt b/src/com/maddyhome/idea/vim/group/NotificationService.kt index 2af1c11dea..897c352821 100644 --- a/src/com/maddyhome/idea/vim/group/NotificationService.kt +++ b/src/com/maddyhome/idea/vim/group/NotificationService.kt @@ -40,6 +40,7 @@ import com.intellij.openapi.ui.Messages import com.intellij.openapi.util.SystemInfo import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.ex.vimscript.VimScriptParser +import com.maddyhome.idea.vim.helper.MessageHelper import com.maddyhome.idea.vim.key.ShortcutOwner import com.maddyhome.idea.vim.key.ShortcutOwnerInfo import com.maddyhome.idea.vim.listener.FindActionId @@ -208,13 +209,15 @@ class NotificationService(private val project: Project?) { } } - class CopyActionId(val id: String?, val project: Project?) : DumbAwareAction("Copy Action Id") { + class CopyActionId(val id: String?, val project: Project?) : DumbAwareAction(MessageHelper.message("action.copy.action.id.text")) { override fun actionPerformed(e: AnActionEvent) { CopyPasteManager.getInstance().setContents(StringSelection(id ?: "")) notification?.expire() val content = if (id == null) "No action id" else "Action id copied: $id" Notification(IDEAVIM_NOTIFICATION_ID, IDEAVIM_NOTIFICATION_TITLE, content, NotificationType.INFORMATION).let { + notification = it + it.whenExpired { notification = null } it.addAction(StopTracking()) it.notify(project) } diff --git a/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt b/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt index 4b16bec5ed..983f375a4b 100644 --- a/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt +++ b/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt @@ -48,6 +48,7 @@ import com.maddyhome.idea.vim.command.CommandState import com.maddyhome.idea.vim.group.visual.IdeaSelectionControl import com.maddyhome.idea.vim.group.visual.moveCaretOneCharLeftFromSelectionEnd import com.maddyhome.idea.vim.helper.EditorDataContext +import com.maddyhome.idea.vim.helper.MessageHelper import com.maddyhome.idea.vim.helper.commandState import com.maddyhome.idea.vim.helper.fileSize import com.maddyhome.idea.vim.helper.getTopLevelEditor @@ -83,11 +84,6 @@ object IdeaSpecifics { if (hostEditor != null) { editor = hostEditor } - - if (FindActionId.enabled) { - val id: String? = ActionManager.getInstance().getId(action) - VimPlugin.getNotifications(dataContext.getData(CommonDataKeys.PROJECT)).notifyActionId(id) - } } override fun afterActionPerformed(action: AnAction, dataContext: DataContext, event: AnActionEvent) { @@ -130,6 +126,16 @@ object IdeaSpecifics { } //endregion + //region Track action id + if (FindActionId.enabled) { + val copyActionText = MessageHelper.message("action.copy.action.id.text") + if (copyActionText != action.templateText) { + val id: String? = ActionManager.getInstance().getId(action) + VimPlugin.getNotifications(dataContext.getData(CommonDataKeys.PROJECT)).notifyActionId(id) + } + } + //endregion + editor = null } } From 6b8d00decf8438d16abcdaab2276c9f476cfb16e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 May 2021 05:30:36 +0000 Subject: [PATCH 04/34] Bump remote-robot from 0.10.3 to 0.11.2 Bumps remote-robot from 0.10.3 to 0.11.2. Signed-off-by: dependabot[bot] --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 519b407c3b..9f9aeaa77f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,7 +55,7 @@ dependencies { testImplementation("com.ensarsarajcic.neovim.java:neovim-api:0.2.3") testImplementation("com.ensarsarajcic.neovim.java:core-rpc:0.2.3") - testImplementation("com.intellij.remoterobot:remote-robot:0.10.3") + testImplementation("com.intellij.remoterobot:remote-robot:0.11.2") testImplementation("com.intellij.remoterobot:remote-fixtures:1.1.18") } From 0cd86282d29daeb86ea0e6afc84b59f02debcc78 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 08:56:34 +0300 Subject: [PATCH 05/34] Use setHtmlText for label --- resources/messages/IdeaVimBundle.properties | 2 +- src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/messages/IdeaVimBundle.properties b/resources/messages/IdeaVimBundle.properties index 9c069a41c4..65fdcb5685 100644 --- a/resources/messages/IdeaVimBundle.properties +++ b/resources/messages/IdeaVimBundle.properties @@ -128,7 +128,7 @@ action.finish.eap.text=Finish EAP action.subscribe.to.eap.text=Subscribe to EAP configurable.name.vim.emulation=Vim Emulation -configurable.keyhandler.link=Use sethandler command to configure handlers from the .ideavimrc file +configurable.keyhandler.link=Use sethandler command to configure handlers from the .ideavimrc file configurable.noneditablehandler.helper.text.with.example=Non editable handlers are defined in .ideavimrc file. E.g. ''{0}'' for {1}. border.title.shortcut.conflicts.for.active.keymap=Shortcut Conflicts for Active Keymap message.no.more.matches=No more matches diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index 4d870c15b8..3d18e51de0 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -116,7 +116,7 @@ public void addHelpLine(VimShortcutConflictsTable.Model model) { }); if (firstPerMode == null) { HyperlinkLabel label = new HyperlinkLabel(); - label.setTextWithHyperlink(MessageHelper.message("configurable.keyhandler.link")); + label.setHtmlText(MessageHelper.message("configurable.keyhandler.link")); label.setHyperlinkTarget("https://jb.gg/abva4t"); label.setForeground(UIUtil.getInactiveTextColor()); add(label, BorderLayout.SOUTH); From 5d344e3193426fc87dab5e66c405283ba2ac4014 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 09:16:19 +0300 Subject: [PATCH 06/34] Rename setkeydev to sethandler --- resources/META-INF/includes/VimExCommands.xml | 2 +- .../handler/{SetKeyHandler.kt => SetHandlerHandler.kt} | 8 +++----- src/com/maddyhome/idea/vim/key/ShortcutOwner.kt | 10 +++++++++- 3 files changed, 13 insertions(+), 7 deletions(-) rename src/com/maddyhome/idea/vim/ex/handler/{SetKeyHandler.kt => SetHandlerHandler.kt} (90%) diff --git a/resources/META-INF/includes/VimExCommands.xml b/resources/META-INF/includes/VimExCommands.xml index 9d839f44d0..a712abbbee 100644 --- a/resources/META-INF/includes/VimExCommands.xml +++ b/resources/META-INF/includes/VimExCommands.xml @@ -46,7 +46,7 @@ - + diff --git a/src/com/maddyhome/idea/vim/ex/handler/SetKeyHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt similarity index 90% rename from src/com/maddyhome/idea/vim/ex/handler/SetKeyHandler.kt rename to src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt index f902d0a122..19340bd826 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/SetKeyHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt @@ -22,7 +22,6 @@ import com.intellij.openapi.actionSystem.DataContext import com.intellij.openapi.editor.Editor import com.maddyhome.idea.vim.VimPlugin import com.maddyhome.idea.vim.ex.CommandHandler -import com.maddyhome.idea.vim.ex.CommandHandlerFlags import com.maddyhome.idea.vim.ex.ExCommand import com.maddyhome.idea.vim.ex.flags import com.maddyhome.idea.vim.ex.vimscript.VimScriptCommandHandler @@ -30,9 +29,8 @@ import com.maddyhome.idea.vim.helper.StringHelper.parseKeys import com.maddyhome.idea.vim.key.ShortcutOwner import com.maddyhome.idea.vim.key.ShortcutOwnerInfo -class SetKeyHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler { - override val argFlags: CommandHandlerFlags = - flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY) +class SetHandlerHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler { + override val argFlags = flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY) override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean { return doCommand(cmd) @@ -77,7 +75,7 @@ class SetKeyHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler if (split.size != 2) return null val left = split[0] - val right = ShortcutOwner.fromStringOrVim(split[1]) + val right = ShortcutOwner.fromStringOrNull(split[1]) ?: return null var currentOwner: ShortcutOwnerInfo.PerMode = owner val modeSplit = left.split("-") diff --git a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt index 3d16870ec2..03ed0e15d5 100644 --- a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt +++ b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt @@ -135,6 +135,14 @@ enum class ShortcutOwner(val ownerName: @NonNls String, private val title: @NonN else -> UNDEFINED } - fun fromStringOrVim(s: String): ShortcutOwner = if (Constants.IDE_STRING.equals(s, ignoreCase = true)) IDE else VIM + fun fromStringOrNull(s: String): ShortcutOwner? { + return if (Constants.IDE_STRING.equals(s, ignoreCase = true)) { + IDE + } else if (Constants.VIM_STRING.equals(s, ignoreCase = true)) { + VIM + } else { + null + } + } } } From ad6b5719d20a538c4ec4409a4e64e0b511a077d7 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 09:23:19 +0300 Subject: [PATCH 07/34] Update copy action description --- src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index 3d18e51de0..3da4ea7f4c 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -370,7 +370,7 @@ private static class CopyForRcAction extends DumbAwareActionButton { private final VimShortcutConflictsTable.Model myModel; public CopyForRcAction(VimShortcutConflictsTable.@NotNull Model model) { - super("Copy for .ideavimrc", "Copy config for .ideavimrc", AllIcons.Actions.Copy); + super("Copy Config for .ideavimrc", "Copy config for .ideavimrc in sethandler format", AllIcons.Actions.Copy); myModel = model; } From e097cd2daa446c545d239728f3a45bc94ec4be68 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 09:44:45 +0300 Subject: [PATCH 08/34] Create sethandler documentation --- doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc b/doc index a821b9f543..14152c7fe6 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit a821b9f543d39dc759ca98f71f11ccff29313287 +Subproject commit 14152c7fe6bfef7022ff060cc71f7e84937872b8 From 43eba0aa1d1233b93a77bdd49c030ce9b6133069 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 09:49:48 +0300 Subject: [PATCH 09/34] Update help link --- doc | 2 +- resources/messages/IdeaVimBundle.properties | 2 +- src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc b/doc index 14152c7fe6..317553a247 160000 --- a/doc +++ b/doc @@ -1 +1 @@ -Subproject commit 14152c7fe6bfef7022ff060cc71f7e84937872b8 +Subproject commit 317553a247efec5c63bd07dff7f70f5c605d6767 diff --git a/resources/messages/IdeaVimBundle.properties b/resources/messages/IdeaVimBundle.properties index 65fdcb5685..e7d1b2df87 100644 --- a/resources/messages/IdeaVimBundle.properties +++ b/resources/messages/IdeaVimBundle.properties @@ -129,7 +129,7 @@ action.subscribe.to.eap.text=Subscribe to EAP configurable.name.vim.emulation=Vim Emulation configurable.keyhandler.link=Use sethandler command to configure handlers from the .ideavimrc file -configurable.noneditablehandler.helper.text.with.example=Non editable handlers are defined in .ideavimrc file. E.g. ''{0}'' for {1}. +configurable.noneditablehandler.helper.text.with.example=Non-editable handlers are defined in .ideavimrc file. E.g. ''{0}'' for {1}. border.title.shortcut.conflicts.for.active.keymap=Shortcut Conflicts for Active Keymap message.no.more.matches=No more matches E223=E223: recursive mapping diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index 3da4ea7f4c..fceae568ee 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -117,7 +117,7 @@ public void addHelpLine(VimShortcutConflictsTable.Model model) { if (firstPerMode == null) { HyperlinkLabel label = new HyperlinkLabel(); label.setHtmlText(MessageHelper.message("configurable.keyhandler.link")); - label.setHyperlinkTarget("https://jb.gg/abva4t"); + label.setHyperlinkTarget("https://jb.gg/vim-sethandler"); label.setForeground(UIUtil.getInactiveTextColor()); add(label, BorderLayout.SOUTH); } @@ -383,7 +383,7 @@ public void actionPerformed(@NotNull AnActionEvent e) { ShortcutOwner owner = ((ShortcutOwnerInfo.AllModes)ownerInfo).getOwner(); if (owner == ShortcutOwner.UNDEFINED) continue; - stringBuilder.append("setkeydev "); + stringBuilder.append("sethandler "); stringBuilder.append(StringHelper.toKeyNotation(row.getKeyStroke())); stringBuilder.append(" "); stringBuilder.append("a:"); From 7765c464f38ac6bbb512ed5f01299f014a43b984 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 09:51:29 +0300 Subject: [PATCH 10/34] Add sethandler to dic --- resources/dictionaries/ideavim.dic | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/dictionaries/ideavim.dic b/resources/dictionaries/ideavim.dic index 2cadf89b35..5ca01b4f1d 100644 --- a/resources/dictionaries/ideavim.dic +++ b/resources/dictionaries/ideavim.dic @@ -39,6 +39,8 @@ maxmapdepth ideacopypreprocess ideatracetime +sethandler + easymotion From 4fdd9b4710274b86aea390be37b91173415fc75c Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 10:56:49 +0300 Subject: [PATCH 11/34] Fix issue with global sethandler --- .../idea/vim/ex/handler/SetHandlerHandler.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt index 19340bd826..68e8a23988 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/SetHandlerHandler.kt @@ -47,23 +47,23 @@ class SetHandlerHandler : CommandHandler.SingleExecution(), VimScriptCommandHand if (args.isEmpty()) return false val key = try { - parseKeys(args[0]).first() + val shortcut = args[0] + if (shortcut.startsWith('<')) parseKeys(shortcut).first() else null } catch (e: IllegalArgumentException) { null } val owner = ShortcutOwnerInfo.allPerModeVim - - val resultingOwner = args.drop(1).fold(owner) { currentOwner: ShortcutOwnerInfo.PerMode?, newData -> + val skipShortcut = if (key == null) 0 else 1 + val resultingOwner = args.drop(skipShortcut).fold(owner) { currentOwner: ShortcutOwnerInfo.PerMode?, newData -> updateOwner(currentOwner, newData) } ?: return false if (key != null) { VimPlugin.getKey().savedShortcutConflicts[key] = resultingOwner } else { - val conflicts = VimPlugin.getKey().savedShortcutConflicts - conflicts.keys.forEach { conflictKey -> - conflicts[conflictKey] = resultingOwner + VimPlugin.getKey().shortcutConflicts.keys.forEach { conflictKey -> + VimPlugin.getKey().savedShortcutConflicts[conflictKey] = resultingOwner } } return true From 15fc2c01bd2f90bdb195c36723cfca09b8172a3e Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 11:21:43 +0300 Subject: [PATCH 12/34] Update changes --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 7ead5cc438..2e06bb9290 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ usual beta standards. ## To Be Released ### Features: +* Support `sethandler` command to configure shortcuts conflicts via `~/.ideavimrc` file. See [docs](https://jb.gg/vim-sethandler). * Support `vim-paragraph-motion` extension [VIM-2290](https://youtrack.jetbrains.com/issue/VIM-2290) | [vim-paragraph-motion](https://github.com/dbakker/vim-paragraph-motion) ### Fixes: @@ -37,6 +38,8 @@ usual beta standards. * [VIM-1476](https://youtrack.jetbrains.com/issue/VIM-1476) Last inserted text is stored in `.` register * [VIM-2295](https://youtrack.jetbrains.com/issue/VIM-2295) Fix `` in insert mode with an existing mappign * [VIM-1401](https://youtrack.jetbrains.com/issue/VIM-1401) IdeaVim triggers readonly handler +* [VIM-1856](https://youtrack.jetbrains.com/issue/VIM-1856) Support defining shortcuts in .ideavimrc +* [VIM-1523](https://youtrack.jetbrains.com/issue/VIM-1523) Allow different shortcut handlers in different modes ### Merged PRs: * [280](https://github.com/JetBrains/ideavim/pull/280) by [Matt Ellis](https://github.com/citizenmatt): Caret position and view scrolling fixes From 2ec9329f2ea74750c40b2e43df99282a58af487b Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 11:31:25 +0300 Subject: [PATCH 13/34] Update plugin.xml --- CHANGES.md | 2 +- resources/META-INF/plugin.xml | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 2e06bb9290..d47db0fb33 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -36,7 +36,7 @@ usual beta standards. * [VIM-2284](https://youtrack.jetbrains.com/issue/VIM-2284) Values are not duplicated in set command * [VIM-2289](https://youtrack.jetbrains.com/issue/VIM-2289) Fix `` command behaviour * [VIM-1476](https://youtrack.jetbrains.com/issue/VIM-1476) Last inserted text is stored in `.` register -* [VIM-2295](https://youtrack.jetbrains.com/issue/VIM-2295) Fix `` in insert mode with an existing mappign +* [VIM-2295](https://youtrack.jetbrains.com/issue/VIM-2295) Fix `` in insert mode with an existing mapping * [VIM-1401](https://youtrack.jetbrains.com/issue/VIM-1401) IdeaVim triggers readonly handler * [VIM-1856](https://youtrack.jetbrains.com/issue/VIM-1856) Support defining shortcuts in .ideavimrc * [VIM-1523](https://youtrack.jetbrains.com/issue/VIM-1523) Allow different shortcut handlers in different modes diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index ade83d1cb3..136aa1b3a0 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -4,6 +4,9 @@ Features:
    +
  • Support sethandler command to configure shortcuts conflicts via ~/.ideavimrc file. + See docs. +
  • Support vim-paragraph-motion extension VIM-2290 | vim-paragraph-motion
  • @@ -31,6 +34,26 @@ VIM-2289 Fix command behaviour +
  • + VIM-1476 + Last inserted text is stored in . register +
  • +
  • + VIM-2295 + Fix in insert mode with an existing mapping +
  • +
  • + VIM-1401 + IdeaVim triggers readonly handler +
  • +
  • + VIM-1856 + Support defining shortcuts in .ideavimrc +
  • +
  • + VIM-1523 + Allow different shortcut handlers in different modes +

Merged PRs:

@@ -43,6 +66,10 @@ 289 by MichalPlacek: VIM-2276 ls returns "absolute path" for files on Microsoft Windows. +
  • + 295 + by MichalPlacek: VIM-1476 +
  • ]]>
    From 383e1d52453c256d641f1abcbeb061285cf7c96a Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 11:51:33 +0300 Subject: [PATCH 14/34] Keep compatibility with easymotion plugin --- .../idea/vim/action/VimShortcutKeyAction.kt | 15 +++++++- .../maddyhome/idea/vim/group/KeyGroup.java | 38 +++++++++++++++---- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/src/com/maddyhome/idea/vim/action/VimShortcutKeyAction.kt b/src/com/maddyhome/idea/vim/action/VimShortcutKeyAction.kt index 27f4cc77de..b2d2e00b1d 100644 --- a/src/com/maddyhome/idea/vim/action/VimShortcutKeyAction.kt +++ b/src/com/maddyhome/idea/vim/action/VimShortcutKeyAction.kt @@ -140,7 +140,20 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ { if (keyStroke in VIM_ONLY_EDITOR_KEYS) return true val savedShortcutConflicts = VimPlugin.getKey().savedShortcutConflicts - return when (savedShortcutConflicts[keyStroke]?.forEditor(editor)) { + val info = savedShortcutConflicts[keyStroke] + if (info is ShortcutOwner) { + return when (info) { + ShortcutOwner.VIM -> true + ShortcutOwner.IDE -> !isShortcutConflict(keyStroke) + else -> { + if (isShortcutConflict(keyStroke)) { + savedShortcutConflicts[keyStroke] = ShortcutOwnerInfo.allUndefined + } + true + } + } + } + return when ((info as? ShortcutOwnerInfo)?.forEditor(editor)) { ShortcutOwner.VIM -> true ShortcutOwner.IDE -> !isShortcutConflict(keyStroke) else -> { diff --git a/src/com/maddyhome/idea/vim/group/KeyGroup.java b/src/com/maddyhome/idea/vim/group/KeyGroup.java index b7690a9aac..a79460a5c6 100644 --- a/src/com/maddyhome/idea/vim/group/KeyGroup.java +++ b/src/com/maddyhome/idea/vim/group/KeyGroup.java @@ -73,7 +73,8 @@ public class KeyGroup implements PersistentStateComponent { private static final Logger logger = Logger.getInstance(KeyGroup.class); - private final @NotNull Map shortcutConflicts = new LinkedHashMap<>(); + // It should be ShortcutOwnerInfo, but we use Object to keep the compatibility with easymotion + private final @NotNull Map shortcutConflicts = new LinkedHashMap<>(); private final @NotNull Set requiredShortcutKeys = new HashSet<>(300); private final @NotNull Map> keyRoots = new EnumMap<>(MappingMode.class); private final @NotNull Map keyMappings = new EnumMap<>(MappingMode.class); @@ -193,9 +194,17 @@ public void setOperatorFunction(@NotNull OperatorFunction function) { public void saveData(@NotNull Element element) { final Element conflictsElement = new Element(SHORTCUT_CONFLICTS_ELEMENT); - for (Map.Entry entry : shortcutConflicts.entrySet()) { + for (Map.Entry entry : shortcutConflicts.entrySet()) { final ShortcutOwner owner; - ShortcutOwnerInfo value = entry.getValue(); + Object myValue = entry.getValue(); + ShortcutOwnerInfo value; + if (myValue instanceof ShortcutOwnerInfo) { + value = (ShortcutOwnerInfo)myValue; + } else if (myValue instanceof ShortcutOwner) { + value = new ShortcutOwnerInfo.AllModes((ShortcutOwner)myValue); + } else { + value = new ShortcutOwnerInfo.AllModes(ShortcutOwner.VIM); + } if (value instanceof ShortcutOwnerInfo.AllModes) { owner = ((ShortcutOwnerInfo.AllModes)value).getOwner(); } @@ -260,22 +269,37 @@ public void readData(@NotNull Element element) { public @NotNull Map getShortcutConflicts() { final Set requiredShortcutKeys = this.requiredShortcutKeys; - final Map savedConflicts = getSavedShortcutConflicts(); + final Map savedConflicts = getSavedShortcutConflicts(); final Map results = new HashMap<>(); for (RequiredShortcut requiredShortcut : requiredShortcutKeys) { KeyStroke keyStroke = requiredShortcut.getKeyStroke(); if (!VimShortcutKeyAction.VIM_ONLY_EDITOR_KEYS.contains(keyStroke)) { final List conflicts = getKeymapConflicts(keyStroke); if (!conflicts.isEmpty()) { - final ShortcutOwnerInfo owner = savedConflicts.get(keyStroke); - results.put(keyStroke, owner != null ? owner : ShortcutOwnerInfo.allUndefined); + final Object owner = savedConflicts.get(keyStroke); + ShortcutOwnerInfo result; + if (owner != null) { + if (owner instanceof ShortcutOwnerInfo) { + result = (ShortcutOwnerInfo)owner; + } + else if (owner instanceof ShortcutOwner) { + result = new ShortcutOwnerInfo.AllModes((ShortcutOwner)owner); + } + else { + result = ShortcutOwnerInfo.allUndefined; + } + } + else { + result = ShortcutOwnerInfo.allUndefined; + } + results.put(keyStroke, result); } } } return results; } - public @NotNull Map getSavedShortcutConflicts() { + public @NotNull Map getSavedShortcutConflicts() { return shortcutConflicts; } From dee78cd5030901e2fea64c0206212e56865b1d5b Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Wed, 12 May 2021 19:54:24 +0300 Subject: [PATCH 15/34] Move to gradle plugin 1.0 --- build.gradle.kts | 30 +++++++++++++++--------------- settings.gradle | 9 +++++++++ 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9f9aeaa77f..475139a351 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,7 +20,7 @@ plugins { java kotlin("jvm") version "1.3.71" - id("org.jetbrains.intellij") version "0.7.3" + id("org.jetbrains.intellij") version "1.0-SNAPSHOT" id("io.gitlab.arturbosch.detekt") version "1.15.0" id("org.jetbrains.changelog") version "1.1.2" @@ -103,24 +103,24 @@ sourceSets { // --- Intellij plugin intellij { - version = ideaVersion - pluginName = "IdeaVim" - updateSinceUntilBuild = false - downloadSources = downloadIdeaSources.toBoolean() - instrumentCode = instrumentPluginCode.toBoolean() - intellijRepo = "https://www.jetbrains.com/intellij-repository" - setPlugins("java") + version.set(ideaVersion) + pluginName.set("IdeaVim") + updateSinceUntilBuild.set(false) + downloadSources.set(downloadIdeaSources.toBoolean()) + instrumentCode.set(instrumentPluginCode.toBoolean()) + intellijRepository.set("https://www.jetbrains.com/intellij-repository") + plugins.set(listOf("java")) } tasks { downloadRobotServerPlugin { - version = "0.10.0" + version.set("0.10.0") } publishPlugin { - channels(publishChannels.split(",")) - username(publishUsername) - token(publishToken) + channels.set(publishChannels.split(",")) + host.set(publishUsername) + token.set(publishToken) } runIdeForUiTests { @@ -128,9 +128,9 @@ tasks { } runPluginVerifier { - ideVersions(listOf("IC-2020.2.3", "IC-2020.3.2")) - downloadDirectory("${project.buildDir}/pluginVerifier/ides") - teamCityOutputFormat = true + ideVersions.set(listOf("IC-2020.2.3", "IC-2020.3.2")) + downloadDir.set("${project.buildDir}/pluginVerifier/ides") + teamCityOutputFormat.set(true) } } diff --git a/settings.gradle b/settings.gradle index bb770be052..5c89b5c51c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,4 +16,13 @@ * along with this program. If not, see . */ +pluginManagement { + repositories { + maven { + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + gradlePluginPortal() + } +} + rootProject.name = 'IdeaVIM' From 270ba9d1963ab5550af0dc56ba6d5167a5064acc Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 10:43:51 +0300 Subject: [PATCH 16/34] Username is not required for token publishing --- build.gradle.kts | 2 -- gradle.properties | 1 - 2 files changed, 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 475139a351..21c9fe36e6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -36,7 +36,6 @@ val downloadIdeaSources: String by project val instrumentPluginCode: String by project val publishChannels: String by project -val publishUsername: String by project val publishToken: String by project val slackUrl: String by project @@ -119,7 +118,6 @@ tasks { publishPlugin { channels.set(publishChannels.split(",")) - host.set(publishUsername) token.set(publishToken) } diff --git a/gradle.properties b/gradle.properties index ca38a2a8dc..549618e557 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,6 @@ javaVersion=1.8 # Please don't forget to update kotlin version in buildscript section kotlinVersion=1.3.71 -publishUsername=username publishToken=token publishChannels=eap From c9eafe1db3c87582a159a677bd90cddac6b8e05b Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 10:47:01 +0300 Subject: [PATCH 17/34] [TC] Username is not required for token publishing --- .teamcity/_Self/buildTypes/Release.kt | 1 - .teamcity/_Self/buildTypes/ReleaseDev.kt | 1 - .teamcity/_Self/buildTypes/ReleaseEap.kt | 1 - .teamcity/_Self/buildTypes/Release_201.kt | 1 - 4 files changed, 4 deletions(-) diff --git a/.teamcity/_Self/buildTypes/Release.kt b/.teamcity/_Self/buildTypes/Release.kt index 7b7af0960d..e433c835d7 100644 --- a/.teamcity/_Self/buildTypes/Release.kt +++ b/.teamcity/_Self/buildTypes/Release.kt @@ -26,7 +26,6 @@ object Release : BuildType({ "credentialsJSON:61a36031-4da1-4226-a876-b8148bf32bde", label = "Password" ) - param("env.ORG_GRADLE_PROJECT_publishUsername", "Aleksei.Plate") param("env.ORG_GRADLE_PROJECT_version", "%build.number%") param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") param("env.ORG_GRADLE_PROJECT_publishChannels", "$DEFAULT,$EAP,$DEV") diff --git a/.teamcity/_Self/buildTypes/ReleaseDev.kt b/.teamcity/_Self/buildTypes/ReleaseDev.kt index db92225a41..a297e7f64c 100644 --- a/.teamcity/_Self/buildTypes/ReleaseDev.kt +++ b/.teamcity/_Self/buildTypes/ReleaseDev.kt @@ -24,7 +24,6 @@ object ReleaseDev : BuildType({ "credentialsJSON:61a36031-4da1-4226-a876-b8148bf32bde", label = "Password" ) - param("env.ORG_GRADLE_PROJECT_publishUsername", "Aleksei.Plate") param("env.ORG_GRADLE_PROJECT_version", "%build.number%") param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") param("env.ORG_GRADLE_PROJECT_publishChannels", DEV) diff --git a/.teamcity/_Self/buildTypes/ReleaseEap.kt b/.teamcity/_Self/buildTypes/ReleaseEap.kt index 0bb924ff62..98ff3d5d06 100644 --- a/.teamcity/_Self/buildTypes/ReleaseEap.kt +++ b/.teamcity/_Self/buildTypes/ReleaseEap.kt @@ -24,7 +24,6 @@ object ReleaseEap : BuildType({ "credentialsJSON:61a36031-4da1-4226-a876-b8148bf32bde", label = "Password" ) - param("env.ORG_GRADLE_PROJECT_publishUsername", "Aleksei.Plate") param("env.ORG_GRADLE_PROJECT_version", "%build.number%") param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") param("env.ORG_GRADLE_PROJECT_publishChannels", EAP) diff --git a/.teamcity/_Self/buildTypes/Release_201.kt b/.teamcity/_Self/buildTypes/Release_201.kt index 5906726743..aba08eee2f 100644 --- a/.teamcity/_Self/buildTypes/Release_201.kt +++ b/.teamcity/_Self/buildTypes/Release_201.kt @@ -24,7 +24,6 @@ object Release_201 : BuildType({ "credentialsJSON:61a36031-4da1-4226-a876-b8148bf32bde", label = "Password" ) - param("env.ORG_GRADLE_PROJECT_publishUsername", "Aleksei.Plate") param("env.ORG_GRADLE_PROJECT_version", "%build.number%") param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") param("env.ORG_GRADLE_PROJECT_publishChannels", "$DEFAULT,$EAP,$DEV") From a646a59d8dc761d558dc0531220531c7bb23f2a5 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 10:51:48 +0300 Subject: [PATCH 18/34] Move toolbar to the right --- src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index fceae568ee..3aa629b881 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -19,6 +19,7 @@ package com.maddyhome.idea.vim.ui; import com.intellij.icons.AllIcons; +import com.intellij.openapi.actionSystem.ActionToolbarPosition; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.KeyboardShortcut; @@ -97,6 +98,7 @@ public VimSettingsPanel(@NotNull VimShortcutConflictsTable.Model model) { setLayout(new BorderLayout()); ToolbarDecorator decorator = ToolbarDecorator.createDecorator(shortcutConflictsTable); + decorator.setToolbarPosition(ActionToolbarPosition.RIGHT); decorator.addExtraAction(new CopyForRcAction(model)); final JPanel scrollPane = decorator.createPanel(); From 4312aceae7c38295815fa7e2aa81297dcc2da61c Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 11:05:24 +0300 Subject: [PATCH 19/34] Do not save per-mode info --- src/com/maddyhome/idea/vim/group/KeyGroup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/maddyhome/idea/vim/group/KeyGroup.java b/src/com/maddyhome/idea/vim/group/KeyGroup.java index a79460a5c6..66c6c9cc9d 100644 --- a/src/com/maddyhome/idea/vim/group/KeyGroup.java +++ b/src/com/maddyhome/idea/vim/group/KeyGroup.java @@ -209,12 +209,12 @@ public void saveData(@NotNull Element element) { owner = ((ShortcutOwnerInfo.AllModes)value).getOwner(); } else if (value instanceof ShortcutOwnerInfo.PerMode) { - owner = ((ShortcutOwnerInfo.PerMode)value).getNormal(); + owner = null; } else { throw new RuntimeException(); } - if (owner != ShortcutOwner.UNDEFINED) { + if (owner != null && owner != ShortcutOwner.UNDEFINED) { final Element conflictElement = new Element(SHORTCUT_CONFLICT_ELEMENT); conflictElement.setAttribute(OWNER_ATTRIBUTE, owner.getOwnerName()); final Element textElement = new Element(TEXT_ELEMENT); From b0bfd0f56eb28f12616430d8566f9544c91df46e Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 11:59:52 +0300 Subject: [PATCH 20/34] Updates for qodana --- .../idea/vim/helper/DigraphResult.java | 2 +- src/com/maddyhome/idea/vim/key/ShortcutOwner.kt | 17 ++++------------- .../maddyhome/idea/vim/option/NumberOption.java | 1 + 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/com/maddyhome/idea/vim/helper/DigraphResult.java b/src/com/maddyhome/idea/vim/helper/DigraphResult.java index de94e15370..3b9f81304e 100644 --- a/src/com/maddyhome/idea/vim/helper/DigraphResult.java +++ b/src/com/maddyhome/idea/vim/helper/DigraphResult.java @@ -42,7 +42,7 @@ private DigraphResult(int result) { stroke = null; } - private DigraphResult(int result, char promptCharacter) { + private DigraphResult(@SuppressWarnings("SameParameterValue") int result, char promptCharacter) { this.result = result; this.promptCharacter = promptCharacter; stroke = null; diff --git a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt index 03ed0e15d5..23778beae4 100644 --- a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt +++ b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt @@ -89,13 +89,6 @@ sealed class ShortcutOwnerInfo { } } - fun toPerMode(): PerMode { - return when (this) { - is PerMode -> this - is AllModes -> PerMode(owner, owner, owner, owner) - } - } - companion object { @JvmField val allUndefined = AllModes(ShortcutOwner.UNDEFINED) @@ -136,12 +129,10 @@ enum class ShortcutOwner(val ownerName: @NonNls String, private val title: @NonN } fun fromStringOrNull(s: String): ShortcutOwner? { - return if (Constants.IDE_STRING.equals(s, ignoreCase = true)) { - IDE - } else if (Constants.VIM_STRING.equals(s, ignoreCase = true)) { - VIM - } else { - null + return when { + Constants.IDE_STRING.equals(s, ignoreCase = true) -> IDE + Constants.VIM_STRING.equals(s, ignoreCase = true) -> VIM + else -> null } } } diff --git a/src/com/maddyhome/idea/vim/option/NumberOption.java b/src/com/maddyhome/idea/vim/option/NumberOption.java index e830b932a8..62abaa3564 100644 --- a/src/com/maddyhome/idea/vim/option/NumberOption.java +++ b/src/com/maddyhome/idea/vim/option/NumberOption.java @@ -52,6 +52,7 @@ public class NumberOption extends TextOption { * @param min The option's minimum value * @param max The option's maximum value */ + @SuppressWarnings("SameParameterValue") NumberOption(@VimNlsSafe String name, @VimNlsSafe String abbrev, int dflt, int min, int max) { super(name, abbrev); this.dflt = dflt; From cec56e78bf76b2795ea3fad378196bea23e26f8b Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 12:02:40 +0300 Subject: [PATCH 21/34] [TC] Remove 201 release job --- .teamcity/_Self/buildTypes/Release_201.kt | 58 ----------------------- .teamcity/_Self/subprojects/Releases.kt | 2 - 2 files changed, 60 deletions(-) delete mode 100644 .teamcity/_Self/buildTypes/Release_201.kt diff --git a/.teamcity/_Self/buildTypes/Release_201.kt b/.teamcity/_Self/buildTypes/Release_201.kt deleted file mode 100644 index aba08eee2f..0000000000 --- a/.teamcity/_Self/buildTypes/Release_201.kt +++ /dev/null @@ -1,58 +0,0 @@ -package _Self.buildTypes - -import _Self.Constants.DEFAULT -import _Self.Constants.DEV -import _Self.Constants.EAP -import _Self.Constants.VERSION -import jetbrains.buildServer.configs.kotlin.v2019_2.BuildType -import jetbrains.buildServer.configs.kotlin.v2019_2.CheckoutMode -import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.gradle -import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric -import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange - -object Release_201 : BuildType({ - name = "Publish Release 2020.1" - description = "Build and publish IdeaVim plugin" - - artifactRules = "build/distributions/*" - buildNumberPattern = "$VERSION-2020.1" - - params { - param("env.ORG_GRADLE_PROJECT_ideaVersion", "2020.1") - password( - "env.ORG_GRADLE_PROJECT_publishToken", - "credentialsJSON:61a36031-4da1-4226-a876-b8148bf32bde", - label = "Password" - ) - param("env.ORG_GRADLE_PROJECT_version", "%build.number%") - param("env.ORG_GRADLE_PROJECT_downloadIdeaSources", "false") - param("env.ORG_GRADLE_PROJECT_publishChannels", "$DEFAULT,$EAP,$DEV") - } - - vcs { - root(_Self.vcsRoots.Branch_201) - - checkoutMode = CheckoutMode.AUTO - } - - steps { - gradle { - tasks = "clean publishPlugin" - buildFile = "" - enableStacktrace = true - param("org.jfrog.artifactory.selectedDeployableServer.defaultModuleVersionConfiguration", "GLOBAL") - } - } - - failureConditions { - failOnMetricChange { - metric = BuildFailureOnMetric.MetricType.ARTIFACT_SIZE - threshold = 5 - units = BuildFailureOnMetric.MetricUnit.PERCENTS - comparison = BuildFailureOnMetric.MetricComparison.DIFF - compareTo = build { - buildRule = lastSuccessful() - } - } - } -}) diff --git a/.teamcity/_Self/subprojects/Releases.kt b/.teamcity/_Self/subprojects/Releases.kt index e4c88f4ddd..5842c5a946 100644 --- a/.teamcity/_Self/subprojects/Releases.kt +++ b/.teamcity/_Self/subprojects/Releases.kt @@ -3,7 +3,6 @@ package _Self.subprojects import _Self.buildTypes.Release import _Self.buildTypes.ReleaseDev import _Self.buildTypes.ReleaseEap -import _Self.buildTypes.Release_201 import jetbrains.buildServer.configs.kotlin.v2019_2.Project object Releases : Project({ @@ -11,7 +10,6 @@ object Releases : Project({ description = "Stable and EAP releases for IdeaVim" buildType(Release) - buildType(Release_201) buildType(ReleaseEap) buildType(ReleaseDev) }) From b1662cdc1a7d1546d6f277e9f9daf7e2159e0750 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 12:05:26 +0300 Subject: [PATCH 22/34] [TC] Remove unused imports --- .teamcity/_Self/subprojects/GitHub.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.teamcity/_Self/subprojects/GitHub.kt b/.teamcity/_Self/subprojects/GitHub.kt index 30ca7de0f5..cce9e9cb1e 100644 --- a/.teamcity/_Self/subprojects/GitHub.kt +++ b/.teamcity/_Self/subprojects/GitHub.kt @@ -2,10 +2,6 @@ package _Self.subprojects import _Self.buildTypes.GithubLint import _Self.buildTypes.GithubTests -import _Self.buildTypes.Release -import _Self.buildTypes.ReleaseDev -import _Self.buildTypes.ReleaseEap -import _Self.buildTypes.Release_201 import jetbrains.buildServer.configs.kotlin.v2019_2.Project object GitHub : Project({ From edf6a04a36aa19d9c3f4de77336be8c90ead41d9 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 13:55:31 +0300 Subject: [PATCH 23/34] Run ktlint --- src/com/maddyhome/idea/vim/key/ShortcutOwner.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt index 23778beae4..aaf70339c2 100644 --- a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt +++ b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt @@ -130,9 +130,9 @@ enum class ShortcutOwner(val ownerName: @NonNls String, private val title: @NonN fun fromStringOrNull(s: String): ShortcutOwner? { return when { - Constants.IDE_STRING.equals(s, ignoreCase = true) -> IDE - Constants.VIM_STRING.equals(s, ignoreCase = true) -> VIM - else -> null + Constants.IDE_STRING.equals(s, ignoreCase = true) -> IDE + Constants.VIM_STRING.equals(s, ignoreCase = true) -> VIM + else -> null } } } From 93d80b8dfb2102d3f54672c59fc650752030e008 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 19:33:56 +0300 Subject: [PATCH 24/34] Move to kotlin 1.5 --- .idea/codeStyles/Project.xml | 11 ++--------- build.gradle.kts | 6 ++++-- gradle.properties | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index a79d111198..a556dd1b16 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -14,6 +14,7 @@ @@ -190,15 +191,7 @@ - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 21c9fe36e6..d1db9c7064 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,14 +11,14 @@ buildscript { } dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0") classpath("com.github.AlexPl292:mark-down-to-slack:1.1.2") } } plugins { java - kotlin("jvm") version "1.3.71" + kotlin("jvm") version "1.5.0" id("org.jetbrains.intellij") version "1.0-SNAPSHOT" id("io.gitlab.arturbosch.detekt") version "1.15.0" @@ -71,12 +71,14 @@ tasks { compileKotlin { kotlinOptions { jvmTarget = javaVersion + apiVersion = "1.3" // allWarningsAsErrors = true } } compileTestKotlin { kotlinOptions { jvmTarget = javaVersion + apiVersion = "1.3" // allWarningsAsErrors = true } } diff --git a/gradle.properties b/gradle.properties index 549618e557..90564bf4cb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ version=SNAPSHOT javaVersion=1.8 # Please don't forget to update kotlin version in buildscript section -kotlinVersion=1.3.71 +kotlinVersion=1.5.0 publishToken=token publishChannels=eap From 879a73494b98914accc8da7607bebfd345986f89 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 19:34:13 +0300 Subject: [PATCH 25/34] Run formatters --- .../change/AutoIndentLinesVisualAction.kt | 2 +- .../change/ChangeCaseLowerMotionAction.kt | 2 +- .../change/ChangeCaseLowerVisualAction.kt | 2 +- .../change/ChangeCaseToggleCharacterAction.kt | 2 +- .../change/ChangeCaseToggleMotionAction.kt | 2 +- .../change/ChangeCaseToggleVisualAction.kt | 2 +- .../change/ChangeCaseUpperMotionAction.kt | 2 +- .../change/ChangeCaseUpperVisualAction.kt | 2 +- .../change/change/ChangeCharacterAction.kt | 2 +- .../change/change/ChangeCharactersAction.kt | 2 +- .../change/change/ChangeEndOfLineAction.kt | 2 +- .../ChangeLastGlobalSearchReplaceAction.kt | 2 +- .../change/ChangeLastSearchReplaceAction.kt | 2 +- .../action/change/change/ChangeLineAction.kt | 2 +- .../change/change/ChangeMotionAction.kt | 2 +- .../change/change/ChangeReplaceAction.kt | 2 +- .../change/change/ChangeVisualAction.kt | 2 +- .../change/ChangeVisualCharacterAction.kt | 2 +- .../change/change/ChangeVisualLinesAction.kt | 2 +- .../change/ChangeVisualLinesEndAction.kt | 2 +- .../change/change/ReformatCodeMotionAction.kt | 2 +- .../change/change/ReformatCodeVisualAction.kt | 2 +- .../change/number/ChangeNumberIncAction.kt | 2 +- .../number/ChangeVisualNumberIncAction.kt | 2 +- .../change/delete/DeleteCharacterAction.kt | 2 +- .../change/delete/DeleteEndOfLineAction.kt | 2 +- .../change/delete/DeleteJoinLinesAction.kt | 2 +- .../delete/DeleteJoinLinesSpacesAction.kt | 2 +- .../delete/DeleteJoinVisualLinesAction.kt | 2 +- .../DeleteJoinVisualLinesSpacesAction.kt | 2 +- .../change/delete/DeleteMotionAction.kt | 2 +- .../change/delete/DeleteVisualAction.kt | 2 +- .../change/delete/DeleteVisualLinesAction.kt | 2 +- .../delete/DeleteVisualLinesEndAction.kt | 2 +- .../change/insert/InsertAfterCursorAction.kt | 2 +- .../change/insert/InsertAfterLineEndAction.kt | 2 +- .../insert/InsertAtPreviousInsertAction.kt | 2 +- .../change/insert/InsertBeforeCursorAction.kt | 2 +- .../insert/InsertBeforeFirstNonBlankAction.kt | 2 +- .../InsertCharacterAboveCursorAction.kt | 2 +- .../InsertCharacterBelowCursorAction.kt | 2 +- .../insert/InsertDeleteInsertedTextAction.kt | 2 +- .../insert/InsertDeletePreviousWordAction.kt | 2 +- .../change/insert/InsertLineStartAction.kt | 2 +- .../change/insert/InsertNewLineAboveAction.kt | 2 +- .../change/insert/InsertNewLineBelowAction.kt | 2 +- .../insert/InsertPreviousInsertAction.kt | 2 +- .../insert/InsertPreviousInsertExitAction.kt | 2 +- .../change/insert/VisualBlockAppendAction.kt | 2 +- .../change/insert/VisualBlockInsertAction.kt | 2 +- .../change/shift/AutoIndentMotionAction.kt | 2 +- .../idea/vim/action/change/shift/ShiftLeft.kt | 6 +- .../vim/action/change/shift/ShiftRight.kt | 6 +- .../idea/vim/action/copy/PutTextAction.kt | 2 +- .../vim/action/copy/PutVisualTextAction.kt | 4 +- .../idea/vim/action/copy/YankVisualAction.kt | 2 +- .../vim/action/copy/YankVisualLinesAction.kt | 2 +- .../vim/action/motion/gn/GnNextTextObject.kt | 2 +- .../action/motion/gn/GnPreviousTextObject.kt | 2 +- .../motion/gn/VisualSelectNextSearch.kt | 2 +- .../motion/gn/VisualSelectPreviousSearch.kt | 2 +- .../motion/leftright/MotionArrowLeftAction.kt | 2 +- .../leftright/MotionArrowRightAction.kt | 2 +- .../motion/leftright/MotionColumnAction.kt | 4 +- .../motion/leftright/MotionEndAction.kt | 2 +- .../leftright/MotionFirstColumnAction.kt | 4 +- .../leftright/MotionFirstNonSpaceAction.kt | 2 +- .../MotionFirstScreenColumnAction.kt | 2 +- .../MotionFirstScreenNonSpaceAction.kt | 2 +- .../motion/leftright/MotionHomeAction.kt | 2 +- .../leftright/MotionLastColumnAction.kt | 12 +-- .../leftright/MotionLastMatchCharAction.kt | 2 +- .../MotionLastMatchCharReverseAction.kt | 2 +- .../leftright/MotionLastNonSpaceAction.kt | 2 +- .../leftright/MotionLastScreenColumnAction.kt | 4 +- .../motion/leftright/MotionLeftAction.kt | 4 +- .../leftright/MotionLeftMatchCharAction.kt | 2 +- .../MotionLeftTillMatchCharAction.kt | 2 +- .../motion/leftright/MotionLeftWrapAction.kt | 2 +- .../leftright/MotionMiddleColumnAction.kt | 2 +- .../motion/leftright/MotionRightAction.kt | 4 +- .../leftright/MotionRightMatchCharAction.kt | 2 +- .../MotionRightTillMatchCharAction.kt | 2 +- .../motion/leftright/MotionRightWrapAction.kt | 2 +- .../motion/mark/MotionGotoFileMarkAction.kt | 4 +- .../mark/MotionGotoFileMarkLineAction.kt | 4 +- .../motion/mark/MotionGotoMarkAction.kt | 4 +- .../motion/mark/MotionGotoMarkLineAction.kt | 4 +- .../motion/mark/MotionJumpNextAction.kt | 2 +- .../motion/mark/MotionJumpPreviousAction.kt | 2 +- .../motion/object/MotionInnerBigWordAction.kt | 2 +- .../object/MotionInnerBlockAngleAction.kt | 2 +- .../object/MotionInnerBlockBackQuoteAction.kt | 2 +- .../object/MotionInnerBlockBraceAction.kt | 2 +- .../object/MotionInnerBlockBracketAction.kt | 2 +- .../MotionInnerBlockDoubleQuoteAction.kt | 2 +- .../object/MotionInnerBlockParenAction.kt | 2 +- .../MotionInnerBlockSingleQuoteAction.kt | 2 +- .../object/MotionInnerBlockTagAction.kt | 2 +- .../object/MotionInnerParagraphAction.kt | 2 +- .../object/MotionInnerSentenceAction.kt | 2 +- .../motion/object/MotionInnerWordAction.kt | 2 +- .../motion/object/MotionOuterBigWordAction.kt | 2 +- .../object/MotionOuterBlockAngleAction.kt | 2 +- .../object/MotionOuterBlockBackQuoteAction.kt | 2 +- .../object/MotionOuterBlockBraceAction.kt | 2 +- .../object/MotionOuterBlockBracketAction.kt | 2 +- .../MotionOuterBlockDoubleQuoteAction.kt | 2 +- .../object/MotionOuterBlockParenAction.kt | 2 +- .../MotionOuterBlockSingleQuoteAction.kt | 2 +- .../object/MotionOuterBlockTagAction.kt | 2 +- .../object/MotionOuterParagraphAction.kt | 2 +- .../object/MotionOuterSentenceAction.kt | 2 +- .../motion/object/MotionOuterWordAction.kt | 2 +- .../screen/MotionFirstScreenLineAction.kt | 2 +- .../screen/MotionLastScreenLineAction.kt | 2 +- .../screen/MotionMiddleScreenLineAction.kt | 2 +- .../motion/search/SearchAgainNextAction.kt | 2 +- .../search/SearchAgainPreviousAction.kt | 2 +- .../motion/search/SearchEntryFwdAction.kt | 2 +- .../motion/search/SearchEntryRevAction.kt | 2 +- .../search/SearchWholeWordBackwardAction.kt | 2 +- .../search/SearchWholeWordForwardAction.kt | 2 +- .../motion/search/SearchWordBackwardAction.kt | 2 +- .../motion/search/SearchWordForwardAction.kt | 2 +- .../select/motion/SelectMotionLeftAction.kt | 2 +- .../select/motion/SelectMotionRightAction.kt | 2 +- .../action/motion/tabs/MotionNextTabAction.kt | 2 +- .../motion/tabs/MotionPreviousTabAction.kt | 2 +- .../motion/text/MotionBigWordEndLeftAction.kt | 2 +- .../text/MotionBigWordEndRightAction.kt | 2 +- .../motion/text/MotionBigWordLeftAction.kt | 2 +- .../motion/text/MotionBigWordRightAction.kt | 2 +- .../motion/text/MotionCamelEndLeftAction.kt | 2 +- .../motion/text/MotionCamelEndRightAction.kt | 2 +- .../motion/text/MotionCamelLeftAction.kt | 2 +- .../motion/text/MotionCamelRightAction.kt | 2 +- .../motion/text/MotionMethodNextEndAction.kt | 2 +- .../text/MotionMethodNextStartAction.kt | 2 +- .../text/MotionMethodPreviousEndAction.kt | 2 +- .../text/MotionMethodPreviousStartAction.kt | 2 +- .../motion/text/MotionNthCharacterAction.kt | 2 +- .../motion/text/MotionParagraphNextAction.kt | 2 +- .../text/MotionParagraphPreviousAction.kt | 2 +- .../text/MotionSectionBackwardEndAction.kt | 2 +- .../text/MotionSectionBackwardStartAction.kt | 2 +- .../text/MotionSectionForwardEndAction.kt | 2 +- .../text/MotionSectionForwardStartAction.kt | 2 +- .../text/MotionSentenceNextEndAction.kt | 2 +- .../text/MotionSentenceNextStartAction.kt | 2 +- .../text/MotionSentencePreviousEndAction.kt | 2 +- .../text/MotionSentencePreviousStartAction.kt | 2 +- .../text/MotionUnmatchedBraceCloseAction.kt | 2 +- .../text/MotionUnmatchedBraceOpenAction.kt | 2 +- .../text/MotionUnmatchedParenCloseAction.kt | 2 +- .../text/MotionUnmatchedParenOpenAction.kt | 2 +- .../motion/text/MotionWordEndLeftAction.kt | 2 +- .../motion/text/MotionWordEndRightAction.kt | 2 +- .../motion/text/MotionWordLeftAction.kt | 4 +- .../motion/text/MotionWordRightAction.kt | 4 +- .../motion/updown/MotionArrowDownAction.kt | 2 +- .../motion/updown/MotionArrowUpAction.kt | 2 +- .../action/motion/updown/MotionDownActions.kt | 6 +- .../updown/MotionDownFirstNonSpaceAction.kt | 4 +- .../MotionDownLess1FirstNonSpaceAction.kt | 2 +- .../updown/MotionGotoLineFirstAction.kt | 4 +- .../motion/updown/MotionGotoLineLastAction.kt | 2 +- .../updown/MotionGotoLineLastEndAction.kt | 4 +- .../updown/MotionPercentOrMatchAction.kt | 2 +- .../action/motion/updown/MotionUpActions.kt | 6 +- .../updown/MotionUpFirstNonSpaceAction.kt | 2 +- .../visual/VisualSelectPreviousAction.kt | 2 +- .../maddyhome/idea/vim/command/Argument.kt | 5 +- src/com/maddyhome/idea/vim/command/Command.kt | 2 +- .../maddyhome/idea/vim/common/CommandAlias.kt | 6 +- src/com/maddyhome/idea/vim/common/Marks.kt | 2 +- src/com/maddyhome/idea/vim/common/Register.kt | 4 +- .../ApplicationConfigurationMigrator.kt | 2 +- .../idea/vim/ex/CommandDefinition.kt | 2 +- .../maddyhome/idea/vim/ex/CommandHandler.kt | 2 +- .../maddyhome/idea/vim/ex/CommandParser.kt | 2 +- .../idea/vim/ex/handler/BufferListHandler.kt | 2 +- .../idea/vim/ex/handler/DeleteLinesHandler.kt | 2 +- .../idea/vim/ex/handler/MoveTextHandler.kt | 2 +- .../idea/vim/ex/handler/SortHandler.kt | 2 +- .../vim/ex/handler/mapping/CommandInfo.kt | 2 +- .../idea/vim/ex/handler/mapping/MapHandler.kt | 2 +- .../maddyhome/idea/vim/ex/ranges/ExRanges.kt | 8 +- .../idea/vim/extension/VimExtensionFacade.kt | 6 +- .../surround/VimSurroundExtension.kt | 7 +- .../idea/vim/group/NotificationService.kt | 2 +- .../maddyhome/idea/vim/group/copy/PutGroup.kt | 28 +++---- .../idea/vim/group/copy/YankGroup.kt | 2 +- .../vim/group/visual/IdeaSelectionControl.kt | 4 +- .../idea/vim/group/visual/VimSelection.kt | 8 +- .../idea/vim/group/visual/VisualGroup.kt | 2 +- .../vim/handler/ChangeEditorActionHandler.kt | 2 +- .../idea/vim/handler/MotionActionHandler.kt | 4 +- .../idea/vim/handler/SpecialKeyHandlers.kt | 4 +- .../vim/handler/TextObjectActionHandler.kt | 2 +- .../handler/VisualOperatorActionHandler.kt | 6 +- .../idea/vim/helper/EditorDataContext.kt | 2 +- src/com/maddyhome/idea/vim/helper/Helper.kt | 8 +- .../idea/vim/helper/SearchHighlightsHelper.kt | 6 +- src/com/maddyhome/idea/vim/key/MappingInfo.kt | 6 +- .../maddyhome/idea/vim/key/ShortcutOwner.kt | 2 +- .../idea/vim/listener/IdeaSpecifics.kt | 8 +- src/com/maddyhome/idea/vim/ui/StatusBar.kt | 2 +- .../maddyhome/idea/vim/ui/ex/ExEditorKit.kt | 77 ++++++++++--------- .../plugins/ideavim/NeovimTesting.kt | 1 + .../jetbrains/plugins/ideavim/TestHelper.kt | 4 +- .../plugins/ideavim/VimOptionTestCase.kt | 2 +- .../jetbrains/plugins/ideavim/VimTestCase.kt | 8 +- test/ui/pages/ActionMenuFixture.kt | 4 +- test/ui/pages/DialogFixture.kt | 4 +- test/ui/pages/Editor.kt | 2 +- test/ui/pages/Gutter.kt | 2 +- test/ui/pages/IdeaFrame.kt | 2 +- test/ui/pages/WelcomeFrame.kt | 1 + 219 files changed, 337 insertions(+), 328 deletions(-) diff --git a/src/com/maddyhome/idea/vim/action/change/change/AutoIndentLinesVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/change/AutoIndentLinesVisualAction.kt index 29ce4810f4..4606df65ce 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/AutoIndentLinesVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/AutoIndentLinesVisualAction.kt @@ -41,7 +41,7 @@ class AutoIndentLinesVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { VimPlugin.getChange().autoIndentRange(editor, caret, context, range.toVimTextRange(true)) return true diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerMotionAction.kt index acfcf24828..452021ebdd 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerMotionAction.kt @@ -40,7 +40,7 @@ class ChangeCaseLowerMotionAction : ChangeEditorActionHandler.ForEachCaret(), Du context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return argument != null && VimPlugin.getChange() diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerVisualAction.kt index a3c1a50ca4..9faf80d8d9 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseLowerVisualAction.kt @@ -43,7 +43,7 @@ class ChangeCaseLowerVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val topLevelEditor = editor.getTopLevelEditor() return VimPlugin.getChange() diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleCharacterAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleCharacterAction.kt index 8893f56b9b..c63d4f56b5 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleCharacterAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleCharacterAction.kt @@ -34,7 +34,7 @@ class ChangeCaseToggleCharacterAction : ChangeEditorActionHandler.ForEachCaret() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().changeCaseToggleCharacter(editor, caret, count) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleMotionAction.kt index 9cb3570cc5..697a0f3ca6 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleMotionAction.kt @@ -40,7 +40,7 @@ class ChangeCaseToggleMotionAction : ChangeEditorActionHandler.ForEachCaret(), D context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return argument != null && VimPlugin.getChange() diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleVisualAction.kt index 629831cd31..dc27547121 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseToggleVisualAction.kt @@ -42,7 +42,7 @@ class ChangeCaseToggleVisualAction : VisualOperatorActionHandler.ForEachCaret() caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { return VimPlugin.getChange() .changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_TOGGLE) diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperMotionAction.kt index 58ddfd361f..2681b96489 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperMotionAction.kt @@ -40,7 +40,7 @@ class ChangeCaseUpperMotionAction : ChangeEditorActionHandler.ForEachCaret(), Du context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return argument != null && VimPlugin.getChange() diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperVisualAction.kt index 629da89747..77a059794e 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCaseUpperVisualAction.kt @@ -42,7 +42,7 @@ class ChangeCaseUpperVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { return VimPlugin.getChange() .changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_UPPER) diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCharacterAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCharacterAction.kt index eb15c0246a..f60d7e9364 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCharacterAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCharacterAction.kt @@ -41,7 +41,7 @@ class ChangeCharacterAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, count, argument.character) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeCharactersAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeCharactersAction.kt index 6d72eadc59..6dc936e179 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeCharactersAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeCharactersAction.kt @@ -41,7 +41,7 @@ class ChangeCharactersAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().changeCharacters(editor, caret, count) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeEndOfLineAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeEndOfLineAction.kt index 7a1022b9a8..9a6962aac0 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeEndOfLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeEndOfLineAction.kt @@ -41,7 +41,7 @@ class ChangeEndOfLineAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().changeEndOfLine(editor, caret, count) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeLastGlobalSearchReplaceAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeLastGlobalSearchReplaceAction.kt index 6cf0bebf64..a1010ba55b 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeLastGlobalSearchReplaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeLastGlobalSearchReplaceAction.kt @@ -34,7 +34,7 @@ class ChangeLastGlobalSearchReplaceAction : ChangeEditorActionHandler.SingleExec context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { val range = LineRange(0, EditorHelper.getLineCount(editor) - 1) return VimPlugin.getSearch() diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeLastSearchReplaceAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeLastSearchReplaceAction.kt index 3b09cb42f3..cb51ddda37 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeLastSearchReplaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeLastSearchReplaceAction.kt @@ -33,7 +33,7 @@ class ChangeLastSearchReplaceAction : ChangeEditorActionHandler.SingleExecution( context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { var result = true for (caret in editor.caretModel.allCarets) { diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeLineAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeLineAction.kt index 925a24cc95..c07d91a057 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeLineAction.kt @@ -42,7 +42,7 @@ class ChangeLineAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { // `S` command is a synonym of `cc` val motion = MotionDownLess1FirstNonSpaceAction() diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeMotionAction.kt index 3368edc881..019248e028 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeMotionAction.kt @@ -39,7 +39,7 @@ class ChangeMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableO context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return argument != null && VimPlugin.getChange().changeMotion(editor, caret, context, count, rawCount, argument) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeReplaceAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeReplaceAction.kt index 0608c3d39b..ffcd725bfd 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeReplaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeReplaceAction.kt @@ -37,7 +37,7 @@ class ChangeReplaceAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().changeReplace(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualAction.kt index 0d2abfeae7..49b0037bd0 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualAction.kt @@ -41,7 +41,7 @@ class ChangeVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { return VimPlugin.getChange().changeRange(editor, caret, range.toVimTextRange(false), range.type, context) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualCharacterAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualCharacterAction.kt index 117f4141c3..2303451777 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualCharacterAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualCharacterAction.kt @@ -44,7 +44,7 @@ class ChangeVisualCharacterAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val argument = cmd.argument return argument != null && diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesAction.kt index 5902c285ed..d78afaa6dd 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesAction.kt @@ -48,7 +48,7 @@ class ChangeVisualLinesAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val textRange = range.toVimTextRange(true) val lineEndForOffset = EditorHelper.getLineEndForOffset(editor, textRange.endOffset) diff --git a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesEndAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesEndAction.kt index cd8c7dee87..42e730b145 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ChangeVisualLinesEndAction.kt @@ -48,7 +48,7 @@ class ChangeVisualLinesEndAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val vimTextRange = range.toVimTextRange(true) return if (range.type == SelectionType.BLOCK_WISE && vimTextRange.isMultiple) { diff --git a/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeMotionAction.kt index 95167ca09e..0ba60424b5 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeMotionAction.kt @@ -39,7 +39,7 @@ class ReformatCodeMotionAction : ChangeEditorActionHandler.ForEachCaret(), Dupli context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return argument != null && VimPlugin.getChange().reformatCodeMotion(editor, caret, context, count, rawCount, argument) diff --git a/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeVisualAction.kt index 7b757b6d4e..d1942230f3 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/ReformatCodeVisualAction.kt @@ -41,7 +41,7 @@ class ReformatCodeVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { VimPlugin.getChange().reformatCodeSelection(editor, caret, range) return true diff --git a/src/com/maddyhome/idea/vim/action/change/change/number/ChangeNumberIncAction.kt b/src/com/maddyhome/idea/vim/action/change/change/number/ChangeNumberIncAction.kt index 45a0694cf7..f502640fdf 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/number/ChangeNumberIncAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/number/ChangeNumberIncAction.kt @@ -34,7 +34,7 @@ sealed class IncAction(val inc: Int) : ChangeEditorActionHandler.ForEachCaret() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().changeNumber(editor, caret, inc * count) } diff --git a/src/com/maddyhome/idea/vim/action/change/change/number/ChangeVisualNumberIncAction.kt b/src/com/maddyhome/idea/vim/action/change/change/number/ChangeVisualNumberIncAction.kt index a08514edb6..6270cee2fc 100644 --- a/src/com/maddyhome/idea/vim/action/change/change/number/ChangeVisualNumberIncAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/change/number/ChangeVisualNumberIncAction.kt @@ -37,7 +37,7 @@ sealed class IncNumber(val inc: Int, private val avalanche: Boolean) : VisualOpe caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { return VimPlugin.getChange() .changeNumberVisualMode(editor, caret, range.toVimTextRange(false), inc * cmd.count, avalanche) diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteCharacterAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteCharacterAction.kt index 55c8022067..2900d01a05 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteCharacterAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteCharacterAction.kt @@ -38,7 +38,7 @@ abstract class DeleteCharacter(private val countModifier: (Int) -> Int) : Change context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().deleteCharacter(editor, caret, countModifier(count), false) } diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteEndOfLineAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteEndOfLineAction.kt index 66bbaf220b..ebaa7386e6 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteEndOfLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteEndOfLineAction.kt @@ -34,7 +34,7 @@ class DeleteEndOfLineAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().deleteEndOfLine(editor, caret, count) } diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesAction.kt index 3058baee07..6beb3678f2 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesAction.kt @@ -35,7 +35,7 @@ class DeleteJoinLinesAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { if (editor.isOneLineMode) return false if (ideajoin.isSet) { diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesSpacesAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesSpacesAction.kt index f4040d0381..30b39f5279 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesSpacesAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinLinesSpacesAction.kt @@ -35,7 +35,7 @@ class DeleteJoinLinesSpacesAction : ChangeEditorActionHandler.SingleExecution() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { if (editor.isOneLineMode) return false if (ideajoin.isSet) { diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesAction.kt index b002f0ca53..577919e467 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesAction.kt @@ -42,7 +42,7 @@ class DeleteJoinVisualLinesAction : VisualOperatorActionHandler.SingleExecution( editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { if (editor.isOneLineMode) return false if (ideajoin.isSet) { diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesSpacesAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesSpacesAction.kt index a46901d315..8ad073b95d 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesSpacesAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteJoinVisualLinesSpacesAction.kt @@ -42,7 +42,7 @@ class DeleteJoinVisualLinesSpacesAction : VisualOperatorActionHandler.SingleExec editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { if (editor.isOneLineMode) return false if (ideajoin.isSet) { diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteMotionAction.kt index 89361a8273..9399fc64f0 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteMotionAction.kt @@ -39,7 +39,7 @@ class DeleteMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableO context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { if (argument == null) return false val (first, second) = VimPlugin.getChange() diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualAction.kt index 85ee0b164c..934777a559 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualAction.kt @@ -41,7 +41,7 @@ class DeleteVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val selectionType = range.type return VimPlugin.getChange().deleteRange(editor, caret, range.toVimTextRange(false), selectionType, false) diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesAction.kt index 8f68fbb658..ef28f9580a 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesAction.kt @@ -45,7 +45,7 @@ class DeleteVisualLinesAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val textRange = range.toVimTextRange(false) val (usedCaret, usedRange, usedType) = when (range.type) { diff --git a/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesEndAction.kt b/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesEndAction.kt index 65dd0d9d66..aef3a11f60 100644 --- a/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/delete/DeleteVisualLinesEndAction.kt @@ -45,7 +45,7 @@ class DeleteVisualLinesEndAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { val vimTextRange = range.toVimTextRange(true) return if (range.type == SelectionType.BLOCK_WISE) { diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterCursorAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterCursorAction.kt index b524007db2..698decc42a 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterCursorAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterCursorAction.kt @@ -37,7 +37,7 @@ class InsertAfterCursorAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertAfterCursor(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterLineEndAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterLineEndAction.kt index 7509ca87b6..88890be9d9 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterLineEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertAfterLineEndAction.kt @@ -37,7 +37,7 @@ class InsertAfterLineEndAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertAfterLineEnd(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertAtPreviousInsertAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertAtPreviousInsertAction.kt index f08527746b..cc9a081bfa 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertAtPreviousInsertAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertAtPreviousInsertAction.kt @@ -37,7 +37,7 @@ class InsertAtPreviousInsertAction : ChangeEditorActionHandler.SingleExecution() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertAtPreviousInsert(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeCursorAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeCursorAction.kt index fa3fe41780..29e362e6a5 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeCursorAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeCursorAction.kt @@ -39,7 +39,7 @@ class InsertBeforeCursorAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertBeforeCursor(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeFirstNonBlankAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeFirstNonBlankAction.kt index 0b5611c8fb..cc2d34fcc7 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeFirstNonBlankAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertBeforeFirstNonBlankAction.kt @@ -37,7 +37,7 @@ class InsertBeforeFirstNonBlankAction : ChangeEditorActionHandler.SingleExecutio context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterAboveCursorAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterAboveCursorAction.kt index cb652f10c5..372bab2110 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterAboveCursorAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterAboveCursorAction.kt @@ -34,7 +34,7 @@ class InsertCharacterAboveCursorAction : ChangeEditorActionHandler.ForEachCaret( context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return if (editor.isOneLineMode) { false diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterBelowCursorAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterBelowCursorAction.kt index 5f0a979748..7831c883fe 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterBelowCursorAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertCharacterBelowCursorAction.kt @@ -34,7 +34,7 @@ class InsertCharacterBelowCursorAction : ChangeEditorActionHandler.ForEachCaret( context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return if (editor.isOneLineMode) { false diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertDeleteInsertedTextAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertDeleteInsertedTextAction.kt index 3c747c6cde..e3a6fcc741 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertDeleteInsertedTextAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertDeleteInsertedTextAction.kt @@ -39,7 +39,7 @@ class InsertDeleteInsertedTextAction : ChangeEditorActionHandler.ForEachCaret() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().insertDeleteInsertedText(editor, caret) } diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertDeletePreviousWordAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertDeletePreviousWordAction.kt index 2920c16c6f..fa3ef91dc8 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertDeletePreviousWordAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertDeletePreviousWordAction.kt @@ -39,7 +39,7 @@ class InsertDeletePreviousWordAction : ChangeEditorActionHandler.ForEachCaret() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { return VimPlugin.getChange().insertDeletePreviousWord(editor, caret) } diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertLineStartAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertLineStartAction.kt index 3352c56628..85f384be0b 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertLineStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertLineStartAction.kt @@ -37,7 +37,7 @@ class InsertLineStartAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertLineStart(editor, context) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineAboveAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineAboveAction.kt index ca78e0d1ca..fe86cc5d05 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineAboveAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineAboveAction.kt @@ -37,7 +37,7 @@ class InsertNewLineAboveAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { if (editor.isOneLineMode) return false VimPlugin.getChange().insertNewLineAbove(editor, context) diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineBelowAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineBelowAction.kt index 5dccb04563..6973cad0f6 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineBelowAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertNewLineBelowAction.kt @@ -37,7 +37,7 @@ class InsertNewLineBelowAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { if (editor.isOneLineMode) return false VimPlugin.getChange().insertNewLineBelow(editor, context) diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertAction.kt index 7901173d73..1e70d664f5 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertAction.kt @@ -32,7 +32,7 @@ class InsertPreviousInsertAction : ChangeEditorActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertPreviousInsert(editor, context, false) return true diff --git a/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertExitAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertExitAction.kt index 2ed4b5058c..e709897607 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertExitAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/InsertPreviousInsertExitAction.kt @@ -41,7 +41,7 @@ class InsertPreviousInsertExitAction : ChangeEditorActionHandler.SingleExecution context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().insertPreviousInsert(editor, context, true) return false diff --git a/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockAppendAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockAppendAction.kt index f2c8a8835b..fb13752e73 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockAppendAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockAppendAction.kt @@ -41,7 +41,7 @@ class VisualBlockAppendAction : VisualOperatorActionHandler.SingleExecution() { editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { if (editor.isOneLineMode) return false val range = caretsAndSelections.values.stream().findFirst().orElse(null) ?: return false diff --git a/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockInsertAction.kt b/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockInsertAction.kt index 794ae6bd6b..70c70675d1 100644 --- a/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockInsertAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/insert/VisualBlockInsertAction.kt @@ -41,7 +41,7 @@ class VisualBlockInsertAction : VisualOperatorActionHandler.SingleExecution() { editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { if (editor.isOneLineMode) return false val vimSelection = caretsAndSelections.values.stream().findFirst().orElse(null) ?: return false diff --git a/src/com/maddyhome/idea/vim/action/change/shift/AutoIndentMotionAction.kt b/src/com/maddyhome/idea/vim/action/change/shift/AutoIndentMotionAction.kt index 39ffad13ca..05d7e7472c 100644 --- a/src/com/maddyhome/idea/vim/action/change/shift/AutoIndentMotionAction.kt +++ b/src/com/maddyhome/idea/vim/action/change/shift/AutoIndentMotionAction.kt @@ -42,7 +42,7 @@ class AutoIndentMotionAction : ChangeEditorActionHandler.ForEachCaret(), Duplica context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { if (argument == null) { return false diff --git a/src/com/maddyhome/idea/vim/action/change/shift/ShiftLeft.kt b/src/com/maddyhome/idea/vim/action/change/shift/ShiftLeft.kt index da9a73a3b3..f435fc94d2 100644 --- a/src/com/maddyhome/idea/vim/action/change/shift/ShiftLeft.kt +++ b/src/com/maddyhome/idea/vim/action/change/shift/ShiftLeft.kt @@ -44,7 +44,7 @@ class ShiftLeftLinesAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().indentLines(editor, caret, context, count, -1) @@ -65,7 +65,7 @@ class ShiftLeftMotionAction : ChangeEditorActionHandler.ForEachCaret(), Duplicab context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { argument ?: return false @@ -84,7 +84,7 @@ class ShiftLeftVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { VimPlugin.getChange().indentRange(editor, caret, context, range.toVimTextRange(false), cmd.count, -1) return true diff --git a/src/com/maddyhome/idea/vim/action/change/shift/ShiftRight.kt b/src/com/maddyhome/idea/vim/action/change/shift/ShiftRight.kt index 21173ff926..edd041b829 100644 --- a/src/com/maddyhome/idea/vim/action/change/shift/ShiftRight.kt +++ b/src/com/maddyhome/idea/vim/action/change/shift/ShiftRight.kt @@ -44,7 +44,7 @@ class ShiftRightLinesAction : ChangeEditorActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { VimPlugin.getChange().indentLines(editor, caret, context, count, 1) @@ -65,7 +65,7 @@ class ShiftRightMotionAction : ChangeEditorActionHandler.ForEachCaret(), Duplica context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean { argument ?: return false @@ -84,7 +84,7 @@ class ShiftRightVisualAction : VisualOperatorActionHandler.ForEachCaret() { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean { VimPlugin.getChange().indentRange(editor, caret, context, range.toVimTextRange(false), cmd.count, 1) return true diff --git a/src/com/maddyhome/idea/vim/action/copy/PutTextAction.kt b/src/com/maddyhome/idea/vim/action/copy/PutTextAction.kt index 70bbcc01f3..6c3605420e 100644 --- a/src/com/maddyhome/idea/vim/action/copy/PutTextAction.kt +++ b/src/com/maddyhome/idea/vim/action/copy/PutTextAction.kt @@ -30,7 +30,7 @@ import com.maddyhome.idea.vim.helper.StringHelper sealed class PutTextBaseAction( private val insertTextBeforeCaret: Boolean, private val indent: Boolean, - private val caretAfterInsertedText: Boolean + private val caretAfterInsertedText: Boolean, ) : ChangeEditorActionHandler.SingleExecution() { override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED diff --git a/src/com/maddyhome/idea/vim/action/copy/PutVisualTextAction.kt b/src/com/maddyhome/idea/vim/action/copy/PutVisualTextAction.kt index 04ad6de8e6..e1b91e2118 100644 --- a/src/com/maddyhome/idea/vim/action/copy/PutVisualTextAction.kt +++ b/src/com/maddyhome/idea/vim/action/copy/PutVisualTextAction.kt @@ -36,7 +36,7 @@ import java.util.* sealed class PutVisualTextBaseAction( private val insertTextBeforeCaret: Boolean, private val indent: Boolean, - private val caretAfterInsertedText: Boolean + private val caretAfterInsertedText: Boolean, ) : VisualOperatorActionHandler.SingleExecution() { override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED @@ -47,7 +47,7 @@ sealed class PutVisualTextBaseAction( editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { if (caretsAndSelections.isEmpty()) return false val textData = VimPlugin.getRegister().lastRegister?.let { PutData.TextData(it.text, it.type, it.transferableData) } diff --git a/src/com/maddyhome/idea/vim/action/copy/YankVisualAction.kt b/src/com/maddyhome/idea/vim/action/copy/YankVisualAction.kt index 51a4f77945..28bb9c7c8f 100644 --- a/src/com/maddyhome/idea/vim/action/copy/YankVisualAction.kt +++ b/src/com/maddyhome/idea/vim/action/copy/YankVisualAction.kt @@ -41,7 +41,7 @@ class YankVisualAction : VisualOperatorActionHandler.SingleExecution() { editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { val selections = caretsAndSelections.values val starts: MutableList = ArrayList() diff --git a/src/com/maddyhome/idea/vim/action/copy/YankVisualLinesAction.kt b/src/com/maddyhome/idea/vim/action/copy/YankVisualLinesAction.kt index bcf8cb8b82..6c636ab979 100644 --- a/src/com/maddyhome/idea/vim/action/copy/YankVisualLinesAction.kt +++ b/src/com/maddyhome/idea/vim/action/copy/YankVisualLinesAction.kt @@ -42,7 +42,7 @@ class YankVisualLinesAction : VisualOperatorActionHandler.SingleExecution() { editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean { val selections = caretsAndSelections.values val starts: MutableList = ArrayList() diff --git a/src/com/maddyhome/idea/vim/action/motion/gn/GnNextTextObject.kt b/src/com/maddyhome/idea/vim/action/motion/gn/GnNextTextObject.kt index ee237658f5..f2ee205ca9 100644 --- a/src/com/maddyhome/idea/vim/action/motion/gn/GnNextTextObject.kt +++ b/src/com/maddyhome/idea/vim/action/motion/gn/GnNextTextObject.kt @@ -41,7 +41,7 @@ class GnNextTextObject : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { if (caret != editor.caretModel.primaryCaret) return null val range = VimPlugin.getSearch().getNextSearchRange(editor, count, true) diff --git a/src/com/maddyhome/idea/vim/action/motion/gn/GnPreviousTextObject.kt b/src/com/maddyhome/idea/vim/action/motion/gn/GnPreviousTextObject.kt index 58b8d0011c..75bcab63cb 100644 --- a/src/com/maddyhome/idea/vim/action/motion/gn/GnPreviousTextObject.kt +++ b/src/com/maddyhome/idea/vim/action/motion/gn/GnPreviousTextObject.kt @@ -41,7 +41,7 @@ class GnPreviousTextObject : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { if (caret != editor.caretModel.primaryCaret) return null val range = VimPlugin.getSearch().getNextSearchRange(editor, count, false) diff --git a/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectNextSearch.kt b/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectNextSearch.kt index 7470b9feb4..eeb9bb6202 100644 --- a/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectNextSearch.kt +++ b/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectNextSearch.kt @@ -37,7 +37,7 @@ class VisualSelectNextSearch : MotionActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().selectNextSearch(editor, count, true).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectPreviousSearch.kt b/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectPreviousSearch.kt index 62f6f6eb2a..d0af003a4b 100644 --- a/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectPreviousSearch.kt +++ b/src/com/maddyhome/idea/vim/action/motion/gn/VisualSelectPreviousSearch.kt @@ -37,7 +37,7 @@ class VisualSelectPreviousSearch : MotionActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().selectNextSearch(editor, count, false).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowLeftAction.kt index 85b108e6bb..ed0dade70a 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowLeftAction.kt @@ -42,7 +42,7 @@ class MotionArrowLeftAction : NonShiftedSpecialKeyHandler(), ComplicatedKeysActi context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int { return VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, -count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowRightAction.kt index 2f330d4b59..e5e20ba8d7 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionArrowRightAction.kt @@ -46,7 +46,7 @@ class MotionArrowRightAction : NonShiftedSpecialKeyHandler(), ComplicatedKeysAct context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int { val allowPastEnd = editor.commandState.mode.isEndAllowed return VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, count, allowPastEnd) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionColumnAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionColumnAction.kt index 871a6874d8..a09568af39 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionColumnAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionColumnAction.kt @@ -35,7 +35,7 @@ class MotionColumnAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToColumn(editor, caret, count - 1, false) } @@ -44,7 +44,7 @@ class MotionColumnAction : MotionActionHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: Command + cmd: Command, ) { caret.vimLastColumn = cmd.count - 1 } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionEndAction.kt index f2aa20b744..e9e6e9cf30 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionEndAction.kt @@ -42,7 +42,7 @@ class MotionEndAction : NonShiftedSpecialKeyHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int { var allow = false if (editor.inInsertMode) { diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstColumnAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstColumnAction.kt index 102c1ed564..b6712c5184 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstColumnAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstColumnAction.kt @@ -40,7 +40,7 @@ class MotionFirstColumnAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineStart(editor, caret).toMotion() } @@ -57,7 +57,7 @@ class MotionFirstColumnInsertModeAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineStart(editor, caret).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstNonSpaceAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstNonSpaceAction.kt index 5cfbaa3696..1fc185ddc8 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstNonSpaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstNonSpaceAction.kt @@ -34,7 +34,7 @@ class MotionFirstNonSpaceAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineStartSkipLeading(editor, caret).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenColumnAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenColumnAction.kt index 50096ddf66..d63eaaf541 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenColumnAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenColumnAction.kt @@ -33,7 +33,7 @@ class MotionFirstScreenColumnAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineScreenStart(editor, caret) } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenNonSpaceAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenNonSpaceAction.kt index 124340777d..666f2e38c6 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenNonSpaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionFirstScreenNonSpaceAction.kt @@ -34,7 +34,7 @@ class MotionFirstScreenNonSpaceAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineScreenStartSkipLeading(editor, caret).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionHomeAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionHomeAction.kt index 6905846d70..1eef5c0015 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionHomeAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionHomeAction.kt @@ -35,7 +35,7 @@ class MotionHomeAction : NonShiftedSpecialKeyHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int { return VimPlugin.getMotion().moveCaretToLineStart(editor, caret) } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastColumnAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastColumnAction.kt index f7afa271a8..6d0a3565bf 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastColumnAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastColumnAction.kt @@ -46,7 +46,7 @@ class MotionLastColumnAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { var allow = false if (editor.inInsertMode) { @@ -65,7 +65,7 @@ class MotionLastColumnAction : MotionActionHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: Command + cmd: Command, ) { caret.vimLastColumn = MotionGroup.LAST_COLUMN } @@ -74,7 +74,7 @@ class MotionLastColumnAction : MotionActionHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: Command + cmd: Command, ) { caret.vimLastColumn = MotionGroup.LAST_COLUMN } @@ -91,7 +91,7 @@ class MotionLastColumnInsertAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { var allow = false if (editor.inInsertMode) { @@ -110,7 +110,7 @@ class MotionLastColumnInsertAction : MotionActionHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: Command + cmd: Command, ) { caret.vimLastColumn = MotionGroup.LAST_COLUMN } @@ -119,7 +119,7 @@ class MotionLastColumnInsertAction : MotionActionHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: Command + cmd: Command, ) { caret.vimLastColumn = MotionGroup.LAST_COLUMN } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharAction.kt index 9b72bdd5ea..818daf83c2 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharAction.kt @@ -33,7 +33,7 @@ class MotionLastMatchCharAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val repeatLastMatchChar = VimPlugin.getMotion().repeatLastMatchChar(editor, caret, count) return if (repeatLastMatchChar < 0) Motion.Error else Motion.AbsoluteOffset(repeatLastMatchChar) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharReverseAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharReverseAction.kt index 1ee73568b5..f7bcc44635 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharReverseAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastMatchCharReverseAction.kt @@ -33,7 +33,7 @@ class MotionLastMatchCharReverseAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val repeatLastMatchChar = VimPlugin.getMotion().repeatLastMatchChar(editor, caret, -count) return if (repeatLastMatchChar < 0) Motion.Error else Motion.AbsoluteOffset(repeatLastMatchChar) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastNonSpaceAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastNonSpaceAction.kt index fbe224ddc3..1582fec1ad 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastNonSpaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastNonSpaceAction.kt @@ -34,7 +34,7 @@ class MotionLastNonSpaceAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineEndSkipLeadingOffset(editor, caret, count - 1).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastScreenColumnAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastScreenColumnAction.kt index 9a2d42fd75..fa679e0efb 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastScreenColumnAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLastScreenColumnAction.kt @@ -39,7 +39,7 @@ class MotionLastScreenColumnAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { var allow = false if (editor.inInsertMode) { @@ -57,7 +57,7 @@ class MotionLastScreenColumnAction : MotionActionHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: Command + cmd: Command, ) { caret.vimLastColumn = MotionGroup.LAST_COLUMN } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftAction.kt index 1bc350af64..61a5e7b0b2 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftAction.kt @@ -39,7 +39,7 @@ class MotionLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val offsetOfHorizontalMotion = VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, -count, false) return if (offsetOfHorizontalMotion < 0) Motion.Error else Motion.AbsoluteOffset(offsetOfHorizontalMotion) @@ -60,7 +60,7 @@ class MotionLeftInsertModeAction : MotionActionHandler.ForEachCaret(), Complicat context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val offsetOfHorizontalMotion = VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, -count, false) return if (offsetOfHorizontalMotion < 0) Motion.Error else Motion.AbsoluteOffset(offsetOfHorizontalMotion) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftMatchCharAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftMatchCharAction.kt index 8687d6b3b1..262586d15f 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftMatchCharAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftMatchCharAction.kt @@ -41,7 +41,7 @@ class MotionLeftMatchCharAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) { return Motion.Error diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftTillMatchCharAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftTillMatchCharAction.kt index 23ec9fe38f..dc610b846b 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftTillMatchCharAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftTillMatchCharAction.kt @@ -41,7 +41,7 @@ class MotionLeftTillMatchCharAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) { return Motion.Error diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftWrapAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftWrapAction.kt index 4db55ef6bc..8c7c43d6aa 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftWrapAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionLeftWrapAction.kt @@ -33,7 +33,7 @@ class MotionLeftWrapAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val moveCaretHorizontalWrap = VimPlugin.getMotion().moveCaretHorizontalWrap(editor, caret, -count) return if (moveCaretHorizontalWrap < 0) Motion.Error else Motion.AbsoluteOffset(moveCaretHorizontalWrap) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionMiddleColumnAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionMiddleColumnAction.kt index f8eb7ff9be..dcad79f9a4 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionMiddleColumnAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionMiddleColumnAction.kt @@ -33,7 +33,7 @@ class MotionMiddleColumnAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToMiddleColumn(editor, caret) } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightAction.kt index c8fc339166..a83452d100 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightAction.kt @@ -40,7 +40,7 @@ class MotionRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, count, true).toMotionOrError() } @@ -60,7 +60,7 @@ class MotionRightInsertAction : MotionActionHandler.ForEachCaret(), ComplicatedK context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().getOffsetOfHorizontalMotion(editor, caret, count, true).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightMatchCharAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightMatchCharAction.kt index 840d2cd558..ead92eaea5 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightMatchCharAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightMatchCharAction.kt @@ -42,7 +42,7 @@ class MotionRightMatchCharAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error val res = VimPlugin.getMotion().moveCaretToNextCharacterOnLine(editor, caret, count, argument.character) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightTillMatchCharAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightTillMatchCharAction.kt index 9c6934a222..76d45a87d3 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightTillMatchCharAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightTillMatchCharAction.kt @@ -42,7 +42,7 @@ class MotionRightTillMatchCharAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error val res = VimPlugin.getMotion().moveCaretToBeforeNextCharacterOnLine(editor, caret, count, argument.character) diff --git a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightWrapAction.kt b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightWrapAction.kt index 7936c16b5d..55869b1681 100644 --- a/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightWrapAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/leftright/MotionRightWrapAction.kt @@ -34,7 +34,7 @@ class MotionRightWrapAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretHorizontalWrap(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkAction.kt b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkAction.kt index 1864413f9a..84737d1891 100644 --- a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkAction.kt @@ -43,7 +43,7 @@ class MotionGotoFileMarkAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error @@ -63,7 +63,7 @@ class MotionGotoFileMarkNoSaveJumpAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error diff --git a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkLineAction.kt b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkLineAction.kt index e5a1b78fa7..4d54f6965e 100644 --- a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoFileMarkLineAction.kt @@ -43,7 +43,7 @@ class MotionGotoFileMarkLineAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error @@ -63,7 +63,7 @@ class MotionGotoFileMarkLineNoSaveJumpAction : MotionActionHandler.ForEachCaret( context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error diff --git a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkAction.kt b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkAction.kt index 4690337799..70dd121560 100644 --- a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkAction.kt @@ -43,7 +43,7 @@ class MotionGotoMarkAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error @@ -63,7 +63,7 @@ class MotionGotoMarkNoSaveJumpAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error diff --git a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkLineAction.kt b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkLineAction.kt index 77bd8be04a..29e8ee7a53 100644 --- a/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/mark/MotionGotoMarkLineAction.kt @@ -43,7 +43,7 @@ class MotionGotoMarkLineAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error @@ -63,7 +63,7 @@ class MotionGotoMarkLineNoSaveJumpAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error diff --git a/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpNextAction.kt b/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpNextAction.kt index fb5561a28f..5c81aa80b3 100644 --- a/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpNextAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpNextAction.kt @@ -34,7 +34,7 @@ class MotionJumpNextAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToJump(editor, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpPreviousAction.kt b/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpPreviousAction.kt index 105848857f..c13c3c4ca4 100644 --- a/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpPreviousAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/mark/MotionJumpPreviousAction.kt @@ -34,7 +34,7 @@ class MotionJumpPreviousAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToJump(editor, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBigWordAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBigWordAction.kt index f9cd025f16..6b93bc6c7d 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBigWordAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBigWordAction.kt @@ -37,7 +37,7 @@ class MotionInnerBigWordAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange { return VimPlugin.getMotion().getWordRange(editor, caret, count, false, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockAngleAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockAngleAction.kt index 6ff18fb05d..acfc6c9d49 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockAngleAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockAngleAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockAngleAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '<') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBackQuoteAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBackQuoteAction.kt index 4219e79ecb..6a0e72108f 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBackQuoteAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBackQuoteAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockBackQuoteAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '`', false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBraceAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBraceAction.kt index 96b4b93e70..cef7654c98 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBraceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBraceAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockBraceAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '{') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBracketAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBracketAction.kt index 6e81ba76de..492663fd11 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBracketAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockBracketAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockBracketAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '[') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockDoubleQuoteAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockDoubleQuoteAction.kt index 3c7558ad26..194fe5aa12 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockDoubleQuoteAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockDoubleQuoteAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockDoubleQuoteAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '"', false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockParenAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockParenAction.kt index 6b7490f309..a493435d3b 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockParenAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockParenAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockParenAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, false, '(') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockSingleQuoteAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockSingleQuoteAction.kt index 58bb2b97bc..e806e41681 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockSingleQuoteAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockSingleQuoteAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockSingleQuoteAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '\'', false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockTagAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockTagAction.kt index a67f07444b..8154593b49 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockTagAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerBlockTagAction.kt @@ -42,7 +42,7 @@ class MotionInnerBlockTagAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockTagRange(editor, caret, count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerParagraphAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerParagraphAction.kt index 05149903b2..fcf883bfc7 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerParagraphAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerParagraphAction.kt @@ -42,7 +42,7 @@ class MotionInnerParagraphAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getParagraphRange(editor, caret, count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerSentenceAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerSentenceAction.kt index 8ecc6c574a..5a3e0c6a65 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerSentenceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerSentenceAction.kt @@ -42,7 +42,7 @@ class MotionInnerSentenceAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange { return VimPlugin.getMotion().getSentenceRange(editor, caret, count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerWordAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerWordAction.kt index 4ba7839c93..fc3ccc9ce1 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerWordAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionInnerWordAction.kt @@ -37,7 +37,7 @@ class MotionInnerWordAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange { return VimPlugin.getMotion().getWordRange(editor, caret, count, false, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBigWordAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBigWordAction.kt index 020697286f..96a927aaf9 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBigWordAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBigWordAction.kt @@ -37,7 +37,7 @@ class MotionOuterBigWordAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange { return VimPlugin.getMotion().getWordRange(editor, caret, count, true, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockAngleAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockAngleAction.kt index edaba17fa0..e6d6a7d426 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockAngleAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockAngleAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockAngleAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '<') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBackQuoteAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBackQuoteAction.kt index 5dc84d3bc5..0e088b73ed 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBackQuoteAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBackQuoteAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockBackQuoteAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '`', true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBraceAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBraceAction.kt index ce595c37fb..9f94100e21 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBraceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBraceAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockBraceAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '{') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBracketAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBracketAction.kt index 3fe32d5e5b..30b3853cd0 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBracketAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockBracketAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockBracketAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '[') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockDoubleQuoteAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockDoubleQuoteAction.kt index eed6c90ffa..d8a21b361e 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockDoubleQuoteAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockDoubleQuoteAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockDoubleQuoteAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '"', true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockParenAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockParenAction.kt index bf5465cb84..786e0ec632 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockParenAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockParenAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockParenAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockRange(editor, caret, count, true, '(') } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockSingleQuoteAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockSingleQuoteAction.kt index c38560d727..49de4cd45b 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockSingleQuoteAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockSingleQuoteAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockSingleQuoteAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockQuoteRange(editor, caret, '\'', true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockTagAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockTagAction.kt index 58062e9ca6..244d8742d3 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockTagAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterBlockTagAction.kt @@ -42,7 +42,7 @@ class MotionOuterBlockTagAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getBlockTagRange(editor, caret, count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterParagraphAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterParagraphAction.kt index 5f14205974..6002672ae9 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterParagraphAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterParagraphAction.kt @@ -42,7 +42,7 @@ class MotionOuterParagraphAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? { return VimPlugin.getMotion().getParagraphRange(editor, caret, count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterSentenceAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterSentenceAction.kt index e983b22bd6..c1f210f179 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterSentenceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterSentenceAction.kt @@ -42,7 +42,7 @@ class MotionOuterSentenceAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange { return VimPlugin.getMotion().getSentenceRange(editor, caret, count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterWordAction.kt b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterWordAction.kt index 09e5991386..9d91b23729 100644 --- a/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterWordAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/object/MotionOuterWordAction.kt @@ -37,7 +37,7 @@ class MotionOuterWordAction : TextObjectActionHandler() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange { return VimPlugin.getMotion().getWordRange(editor, caret, count, true, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/screen/MotionFirstScreenLineAction.kt b/src/com/maddyhome/idea/vim/action/motion/screen/MotionFirstScreenLineAction.kt index 0ed91fd579..f85f1c3f7f 100644 --- a/src/com/maddyhome/idea/vim/action/motion/screen/MotionFirstScreenLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/screen/MotionFirstScreenLineAction.kt @@ -52,7 +52,7 @@ abstract class MotionFirstScreenLineActionBase(private val operatorPending: Bool context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { // Only apply scrolloff for NX motions. For op pending, use the actual first line and apply scrolloff after. diff --git a/src/com/maddyhome/idea/vim/action/motion/screen/MotionLastScreenLineAction.kt b/src/com/maddyhome/idea/vim/action/motion/screen/MotionLastScreenLineAction.kt index 5ec48e5554..187b79c902 100644 --- a/src/com/maddyhome/idea/vim/action/motion/screen/MotionLastScreenLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/screen/MotionLastScreenLineAction.kt @@ -52,7 +52,7 @@ abstract class MotionLastScreenLineActionBase(private val operatorPending: Boole context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLastScreenLine(editor, caret, count, !operatorPending).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/screen/MotionMiddleScreenLineAction.kt b/src/com/maddyhome/idea/vim/action/motion/screen/MotionMiddleScreenLineAction.kt index 51390aa0aa..c3d4312196 100644 --- a/src/com/maddyhome/idea/vim/action/motion/screen/MotionMiddleScreenLineAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/screen/MotionMiddleScreenLineAction.kt @@ -46,7 +46,7 @@ class MotionMiddleScreenLineAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToMiddleScreenLine(editor, caret).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainNextAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainNextAction.kt index 432d687c4c..1b36751efc 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainNextAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainNextAction.kt @@ -39,7 +39,7 @@ class SearchAgainNextAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getSearch().searchNext(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainPreviousAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainPreviousAction.kt index 015c6a4d5a..b2a8cde073 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainPreviousAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchAgainPreviousAction.kt @@ -39,7 +39,7 @@ class SearchAgainPreviousAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getSearch().searchPrevious(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryFwdAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryFwdAction.kt index e67a197a01..960661fa7a 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryFwdAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryFwdAction.kt @@ -42,7 +42,7 @@ class SearchEntryFwdAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error return VimPlugin.getSearch() diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryRevAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryRevAction.kt index cfdd1b9516..a16eea29eb 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryRevAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchEntryRevAction.kt @@ -42,7 +42,7 @@ class SearchEntryRevAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { if (argument == null) return Motion.Error return VimPlugin.getSearch() diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordBackwardAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordBackwardAction.kt index f511284da5..6d34a73166 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordBackwardAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordBackwardAction.kt @@ -40,7 +40,7 @@ class SearchWholeWordBackwardAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getSearch().searchWord(editor, caret, count, true, Direction.BACKWARDS).toMotionOrNoMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordForwardAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordForwardAction.kt index ffad93d6af..b7298db054 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordForwardAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchWholeWordForwardAction.kt @@ -40,7 +40,7 @@ class SearchWholeWordForwardAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getSearch().searchWord(editor, caret, count, true, Direction.FORWARDS).toMotionOrNoMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchWordBackwardAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchWordBackwardAction.kt index a8ee2cb178..cd1735cf1e 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchWordBackwardAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchWordBackwardAction.kt @@ -40,7 +40,7 @@ class SearchWordBackwardAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getSearch().searchWord(editor, caret, count, false, Direction.BACKWARDS).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/search/SearchWordForwardAction.kt b/src/com/maddyhome/idea/vim/action/motion/search/SearchWordForwardAction.kt index 31f9e2cd41..5a7101ce1e 100644 --- a/src/com/maddyhome/idea/vim/action/motion/search/SearchWordForwardAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/search/SearchWordForwardAction.kt @@ -40,7 +40,7 @@ class SearchWordForwardAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getSearch().searchWord(editor, caret, count, false, Direction.FORWARDS).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionLeftAction.kt index 4f47e98b1a..535890d002 100644 --- a/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionLeftAction.kt @@ -48,7 +48,7 @@ class SelectMotionLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val keymodel = OptionsManager.keymodel if (KeyModelOptionData.stopsel in keymodel || KeyModelOptionData.stopselect in keymodel) { diff --git a/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionRightAction.kt index fcaee38b32..a49d56637c 100644 --- a/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/select/motion/SelectMotionRightAction.kt @@ -48,7 +48,7 @@ class SelectMotionRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val keymodel = OptionsManager.keymodel if (KeyModelOptionData.stopsel in keymodel || KeyModelOptionData.stopselect in keymodel) { diff --git a/src/com/maddyhome/idea/vim/action/motion/tabs/MotionNextTabAction.kt b/src/com/maddyhome/idea/vim/action/motion/tabs/MotionNextTabAction.kt index ad28f7555f..44a157b6b6 100644 --- a/src/com/maddyhome/idea/vim/action/motion/tabs/MotionNextTabAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/tabs/MotionNextTabAction.kt @@ -35,7 +35,7 @@ class MotionNextTabAction : MotionActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretGotoNextTab(editor, context, rawCount).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/tabs/MotionPreviousTabAction.kt b/src/com/maddyhome/idea/vim/action/motion/tabs/MotionPreviousTabAction.kt index 99246434b4..b5688b2504 100644 --- a/src/com/maddyhome/idea/vim/action/motion/tabs/MotionPreviousTabAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/tabs/MotionPreviousTabAction.kt @@ -35,7 +35,7 @@ class MotionPreviousTabAction : MotionActionHandler.SingleExecution() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretGotoPreviousTab(editor, context, rawCount).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndLeftAction.kt index b18b1ee71e..8736b87188 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndLeftAction.kt @@ -33,7 +33,7 @@ class MotionBigWordEndLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, -count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndRightAction.kt index 64af9ad942..6f1a091316 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordEndRightAction.kt @@ -33,7 +33,7 @@ class MotionBigWordEndRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordLeftAction.kt index 3df31e9ff2..1e12e418b2 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordLeftAction.kt @@ -33,7 +33,7 @@ class MotionBigWordLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().findOffsetOfNextWord(editor, caret.offset, -count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordRightAction.kt index b71769cf04..f0ef3d5377 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionBigWordRightAction.kt @@ -33,7 +33,7 @@ class MotionBigWordRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().findOffsetOfNextWord(editor, caret.offset, count, true) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndLeftAction.kt index bc4ee1d614..0cbde26018 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndLeftAction.kt @@ -34,7 +34,7 @@ class MotionCamelEndLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextCamelEnd(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndRightAction.kt index 96986f560d..b514b31342 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelEndRightAction.kt @@ -34,7 +34,7 @@ class MotionCamelEndRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextCamelEnd(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelLeftAction.kt index 9d248413c9..51b4685533 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelLeftAction.kt @@ -34,7 +34,7 @@ class MotionCamelLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextCamel(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelRightAction.kt index 4f1edbdc5b..778ab9f434 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionCamelRightAction.kt @@ -34,7 +34,7 @@ class MotionCamelRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextCamel(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextEndAction.kt index 37cb1913ed..051a07c921 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextEndAction.kt @@ -38,7 +38,7 @@ class MotionMethodNextEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val moveCaretToMethodEnd = VimPlugin.getMotion().moveCaretToMethodEnd(editor, caret, count) return if (moveCaretToMethodEnd < 0) Motion.Error else Motion.AbsoluteOffset(moveCaretToMethodEnd) diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextStartAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextStartAction.kt index d842f4dfe1..71bcc706bf 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodNextStartAction.kt @@ -38,7 +38,7 @@ class MotionMethodNextStartAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val moveCaretToMethodStart = VimPlugin.getMotion().moveCaretToMethodStart(editor, caret, count) return if (moveCaretToMethodStart < 0) Motion.Error else Motion.AbsoluteOffset(moveCaretToMethodStart) diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousEndAction.kt index 9039664af3..3e994e30a1 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousEndAction.kt @@ -39,7 +39,7 @@ class MotionMethodPreviousEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToMethodEnd(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousStartAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousStartAction.kt index 606e7a3582..15d5389960 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionMethodPreviousStartAction.kt @@ -39,7 +39,7 @@ class MotionMethodPreviousStartAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToMethodStart(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionNthCharacterAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionNthCharacterAction.kt index 303490b082..6379433205 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionNthCharacterAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionNthCharacterAction.kt @@ -39,7 +39,7 @@ class MotionNthCharacterAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNthCharacter(editor, count - 1).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphNextAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphNextAction.kt index a088ebc20f..2964bef174 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphNextAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphNextAction.kt @@ -39,7 +39,7 @@ class MotionParagraphNextAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextParagraph(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphPreviousAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphPreviousAction.kt index fe2ad1aff0..18640eaf55 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphPreviousAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionParagraphPreviousAction.kt @@ -39,7 +39,7 @@ class MotionParagraphPreviousAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextParagraph(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardEndAction.kt index 85986bda90..5af104736e 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardEndAction.kt @@ -39,7 +39,7 @@ class MotionSectionBackwardEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToSection(editor, caret, '}', -1, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardStartAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardStartAction.kt index 185f0d08d9..529947ed4b 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionBackwardStartAction.kt @@ -39,7 +39,7 @@ class MotionSectionBackwardStartAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToSection(editor, caret, '{', -1, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardEndAction.kt index 8a874d411f..a4004833f9 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardEndAction.kt @@ -39,7 +39,7 @@ class MotionSectionForwardEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToSection(editor, caret, '}', 1, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardStartAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardStartAction.kt index 6b15700c81..971deda280 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSectionForwardStartAction.kt @@ -39,7 +39,7 @@ class MotionSectionForwardStartAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToSection(editor, caret, '{', 1, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextEndAction.kt index 0a14a45c1b..8172da57a9 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextEndAction.kt @@ -39,7 +39,7 @@ class MotionSentenceNextEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextSentenceEnd(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextStartAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextStartAction.kt index 686ec77f3a..7c600cac5d 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentenceNextStartAction.kt @@ -39,7 +39,7 @@ class MotionSentenceNextStartAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextSentenceStart(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousEndAction.kt index c20d7d2ac3..b3bff735d6 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousEndAction.kt @@ -39,7 +39,7 @@ class MotionSentencePreviousEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextSentenceEnd(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousStartAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousStartAction.kt index 4559291186..d68364224a 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousStartAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionSentencePreviousStartAction.kt @@ -39,7 +39,7 @@ class MotionSentencePreviousStartAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextSentenceStart(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceCloseAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceCloseAction.kt index 08f0c27752..91a8fdc4ec 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceCloseAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceCloseAction.kt @@ -39,7 +39,7 @@ class MotionUnmatchedBraceCloseAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, count, '}').toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceOpenAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceOpenAction.kt index 23a8c8b347..7637d0f21a 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceOpenAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedBraceOpenAction.kt @@ -39,7 +39,7 @@ class MotionUnmatchedBraceOpenAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, count, '{').toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenCloseAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenCloseAction.kt index e933ef4891..d62d058183 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenCloseAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenCloseAction.kt @@ -39,7 +39,7 @@ class MotionUnmatchedParenCloseAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, count, ')').toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenOpenAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenOpenAction.kt index 971a96d074..3f45a76bff 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenOpenAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionUnmatchedParenOpenAction.kt @@ -39,7 +39,7 @@ class MotionUnmatchedParenOpenAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToUnmatchedBlock(editor, caret, count, '(').toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndLeftAction.kt index 6889886048..1dd093d142 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndLeftAction.kt @@ -33,7 +33,7 @@ class MotionWordEndLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, -count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndRightAction.kt index bb72d1fab6..1935d0c527 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndRightAction.kt @@ -33,7 +33,7 @@ class MotionWordEndRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToNextWordEnd(editor, caret, count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordLeftAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordLeftAction.kt index a5eb4dbbb7..1aae49b755 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordLeftAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordLeftAction.kt @@ -43,7 +43,7 @@ class MotionWordLeftAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().findOffsetOfNextWord(editor, caret.offset, -count, false) } @@ -65,7 +65,7 @@ class MotionWordLeftInsertAction : MotionActionHandler.ForEachCaret(), Complicat context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().findOffsetOfNextWord(editor, caret.offset, -count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordRightAction.kt b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordRightAction.kt index 7155c54511..79c4d849b4 100644 --- a/src/com/maddyhome/idea/vim/action/motion/text/MotionWordRightAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/text/MotionWordRightAction.kt @@ -43,7 +43,7 @@ class MotionWordRightAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().findOffsetOfNextWord(editor, caret.offset, count, false) } @@ -65,7 +65,7 @@ class MotionWordRightInsertAction : MotionActionHandler.ForEachCaret(), Complica context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().findOffsetOfNextWord(editor, caret.offset, count, false) } diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowDownAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowDownAction.kt index 1abe51d4c4..310ca7fd05 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowDownAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowDownAction.kt @@ -46,7 +46,7 @@ class MotionArrowDownAction : NonShiftedSpecialKeyHandler(), ComplicatedKeysActi context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int { return VimPlugin.getMotion().moveCaretVertical(editor, caret, count) } diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowUpAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowUpAction.kt index 9de174c98d..8a3f5fc62f 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowUpAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionArrowUpAction.kt @@ -46,7 +46,7 @@ class MotionArrowUpAction : NonShiftedSpecialKeyHandler(), ComplicatedKeysAction context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int { return VimPlugin.getMotion().moveCaretVertical(editor, caret, -count) } diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownActions.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownActions.kt index 4fd27fe617..65e95bf0d1 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownActions.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownActions.kt @@ -58,7 +58,7 @@ open class MotionDownAction : MotionDownBase() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretVertical(editor, caret, count).toMotionOrError() } @@ -71,7 +71,7 @@ class MotionDownCtrlNAction : MotionDownAction() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val activeLookup = LookupManager.getActiveLookup(editor) return if (activeLookup != null) { @@ -98,7 +98,7 @@ class MotionDownNotLineWiseAction : MotionDownBase() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretVertical(editor, caret, count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownFirstNonSpaceAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownFirstNonSpaceAction.kt index 6c29d43583..3540d4d561 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownFirstNonSpaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownFirstNonSpaceAction.kt @@ -40,7 +40,7 @@ class MotionDownFirstNonSpaceAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineStartSkipLeadingOffset(editor, caret, count).toMotion() } @@ -55,7 +55,7 @@ class EnterNormalAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val templateState = TemplateManagerImpl.getTemplateState(editor) return if (templateState != null) { diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownLess1FirstNonSpaceAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownLess1FirstNonSpaceAction.kt index 9326ed56c2..d9cb614217 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownLess1FirstNonSpaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownLess1FirstNonSpaceAction.kt @@ -36,7 +36,7 @@ class MotionDownLess1FirstNonSpaceAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineStartSkipLeadingOffset(editor, caret, count - 1).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineFirstAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineFirstAction.kt index 2404ba0c2a..b84d45fa12 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineFirstAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineFirstAction.kt @@ -43,7 +43,7 @@ class MotionGotoLineFirstAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val line = EditorHelper.normalizeLine(editor, count - 1) return VimPlugin.getMotion().moveCaretToLineWithStartOfLineOption(editor, line, caret).toMotion() @@ -61,7 +61,7 @@ class MotionGotoLineFirstInsertAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val line = EditorHelper.normalizeLine(editor, count - 1) return VimPlugin.getMotion().moveCaretToLineStart(editor, line).toMotion() diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastAction.kt index 4f4e4e783a..fba1ff9dee 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastAction.kt @@ -42,7 +42,7 @@ class MotionGotoLineLastAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val line = EditorHelper.normalizeLine( editor, diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastEndAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastEndAction.kt index b2b4a48578..8b18d44177 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastEndAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastEndAction.kt @@ -45,7 +45,7 @@ class MotionGotoLineLastEndAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { var allow = false if (editor.inInsertMode) { @@ -72,7 +72,7 @@ class MotionGotoLineLastEndInsertAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { var allow = false if (editor.inInsertMode) { diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionPercentOrMatchAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionPercentOrMatchAction.kt index 53c9f86645..0f17eed4e6 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionPercentOrMatchAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionPercentOrMatchAction.kt @@ -41,7 +41,7 @@ class MotionPercentOrMatchAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return if (rawCount == 0) { VimPlugin.getMotion().moveCaretToMatchingPair(editor, caret).toMotionOrError() diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpActions.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpActions.kt index bafaf5e250..632ed041d3 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpActions.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpActions.kt @@ -57,7 +57,7 @@ open class MotionUpAction : MotionUpBase() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretVertical(editor, caret, -count).toMotionOrError() } @@ -70,7 +70,7 @@ class MotionUpCtrlPAction : MotionUpAction() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val activeLookup = LookupManager.getActiveLookup(editor) return if (activeLookup != null) { @@ -96,7 +96,7 @@ class MotionUpNotLineWiseAction : MotionUpBase() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretVertical(editor, caret, -count).toMotionOrError() } diff --git a/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpFirstNonSpaceAction.kt b/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpFirstNonSpaceAction.kt index a8758dadbc..62a7da9805 100644 --- a/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpFirstNonSpaceAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpFirstNonSpaceAction.kt @@ -36,7 +36,7 @@ class MotionUpFirstNonSpaceAction : MotionActionHandler.ForEachCaret() { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return VimPlugin.getMotion().moveCaretToLineStartSkipLeadingOffset(editor, caret, -count).toMotion() } diff --git a/src/com/maddyhome/idea/vim/action/motion/visual/VisualSelectPreviousAction.kt b/src/com/maddyhome/idea/vim/action/motion/visual/VisualSelectPreviousAction.kt index 1c84725a12..297a3fd998 100644 --- a/src/com/maddyhome/idea/vim/action/motion/visual/VisualSelectPreviousAction.kt +++ b/src/com/maddyhome/idea/vim/action/motion/visual/VisualSelectPreviousAction.kt @@ -32,7 +32,7 @@ class VisualSelectPreviousAction : VimActionHandler.SingleExecution() { override fun execute( editor: Editor, context: DataContext, - cmd: Command + cmd: Command, ): Boolean { // FIXME: 2019-03-05 Make it multicaret return VimPlugin.getVisualMotion().selectPreviousVisualMode(editor) } diff --git a/src/com/maddyhome/idea/vim/command/Argument.kt b/src/com/maddyhome/idea/vim/command/Argument.kt index 4808daa2e8..f7a15845f4 100644 --- a/src/com/maddyhome/idea/vim/command/Argument.kt +++ b/src/com/maddyhome/idea/vim/command/Argument.kt @@ -34,7 +34,7 @@ class Argument private constructor( val motion: Command = EMPTY_COMMAND, val offsets: Map = emptyMap(), val string: String = "", - val type: Type + val type: Type, ) { constructor(motionArg: Command) : this(motion = motionArg, type = Type.MOTION) constructor(charArg: Char) : this(character = charArg, type = Type.CHARACTER) @@ -50,7 +50,8 @@ class Argument private constructor( val EMPTY_COMMAND = Command( 0, object : MotionActionHandler.SingleExecution() { - override fun getOffset(editor: Editor, context: DataContext, count: Int, rawCount: Int, argument: Argument?) = Motion.NoMotion + override fun getOffset(editor: Editor, context: DataContext, count: Int, rawCount: Int, argument: Argument?) = + Motion.NoMotion override val motionType: MotionType = MotionType.EXCLUSIVE }, diff --git a/src/com/maddyhome/idea/vim/command/Command.kt b/src/com/maddyhome/idea/vim/command/Command.kt index 5216c96394..d920093695 100644 --- a/src/com/maddyhome/idea/vim/command/Command.kt +++ b/src/com/maddyhome/idea/vim/command/Command.kt @@ -34,7 +34,7 @@ data class Command( var rawCount: Int, var action: EditorActionHandlerBase, val type: Type, - var flags: EnumSet + var flags: EnumSet, ) { constructor(rawCount: Int, register: Char) : this( diff --git a/src/com/maddyhome/idea/vim/common/CommandAlias.kt b/src/com/maddyhome/idea/vim/common/CommandAlias.kt index 0ea2ea01db..86deb6d3ec 100644 --- a/src/com/maddyhome/idea/vim/common/CommandAlias.kt +++ b/src/com/maddyhome/idea/vim/common/CommandAlias.kt @@ -30,14 +30,14 @@ import org.jetbrains.annotations.NonNls sealed class CommandAlias( protected val minimumNumberOfArguments: Int, protected val maximumNumberOfArguments: Int, - val name: String + val name: String, ) { class Ex( minimumNumberOfArguments: Int, maximumNumberOfArguments: Int, name: String, - val command: String + val command: String, ) : CommandAlias(minimumNumberOfArguments, maximumNumberOfArguments, name) { override fun getCommand(input: String, count: Int): GoalCommand { if (this.maximumNumberOfArguments == 0 && this.maximumNumberOfArguments == 0) { @@ -77,7 +77,7 @@ sealed class CommandAlias( minimumNumberOfArguments: Int, maximumNumberOfArguments: Int, name: String, - val handler: CommandAliasHandler + val handler: CommandAliasHandler, ) : CommandAlias(minimumNumberOfArguments, maximumNumberOfArguments, name) { override fun getCommand(input: String, count: Int): GoalCommand { return GoalCommand.Call(handler) diff --git a/src/com/maddyhome/idea/vim/common/Marks.kt b/src/com/maddyhome/idea/vim/common/Marks.kt index ffd8d0c968..54cee0f728 100644 --- a/src/com/maddyhome/idea/vim/common/Marks.kt +++ b/src/com/maddyhome/idea/vim/common/Marks.kt @@ -54,7 +54,7 @@ data class VimMark( override var logicalLine: Int, override val col: Int, override val filename: String, - override val protocol: String + override val protocol: String, ) : Mark { private var cleared = false diff --git a/src/com/maddyhome/idea/vim/common/Register.kt b/src/com/maddyhome/idea/vim/common/Register.kt index a2ee8ba9a9..0fbda8941f 100644 --- a/src/com/maddyhome/idea/vim/common/Register.kt +++ b/src/com/maddyhome/idea/vim/common/Register.kt @@ -43,7 +43,7 @@ class Register { name: Char, type: SelectionType, text: String, - transferableData: MutableList + transferableData: MutableList, ) { this.name = name this.type = type @@ -57,7 +57,7 @@ class Register { type: SelectionType, text: String, transferableData: MutableList, - rawText: String + rawText: String, ) { this.name = name this.type = type diff --git a/src/com/maddyhome/idea/vim/config/migration/ApplicationConfigurationMigrator.kt b/src/com/maddyhome/idea/vim/config/migration/ApplicationConfigurationMigrator.kt index dcb031ae49..1b9220cae5 100644 --- a/src/com/maddyhome/idea/vim/config/migration/ApplicationConfigurationMigrator.kt +++ b/src/com/maddyhome/idea/vim/config/migration/ApplicationConfigurationMigrator.kt @@ -37,7 +37,7 @@ private val productionMigrationComponents = MigrationComponents( class MigrationComponents( val migrators: Set, val versionDetectors: List, - val currentVersion: Int + val currentVersion: Int, ) { val groupedMigrators: Map = registerMigrators(migrators) diff --git a/src/com/maddyhome/idea/vim/ex/CommandDefinition.kt b/src/com/maddyhome/idea/vim/ex/CommandDefinition.kt index 14f7c9fb2f..7e60b0ff1f 100644 --- a/src/com/maddyhome/idea/vim/ex/CommandDefinition.kt +++ b/src/com/maddyhome/idea/vim/ex/CommandDefinition.kt @@ -30,5 +30,5 @@ fun flags( rangeFlag: CommandHandler.RangeFlag, argumentFlag: CommandHandler.ArgumentFlag, access: CommandHandler.Access, - vararg flags: CommandHandler.Flag + vararg flags: CommandHandler.Flag, ) = CommandHandlerFlags(rangeFlag, argumentFlag, access, flags.toSet()) diff --git a/src/com/maddyhome/idea/vim/ex/CommandHandler.kt b/src/com/maddyhome/idea/vim/ex/CommandHandler.kt index 0e3518d4b5..e3bd26efe5 100644 --- a/src/com/maddyhome/idea/vim/ex/CommandHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/CommandHandler.kt @@ -200,5 +200,5 @@ data class CommandHandlerFlags( val rangeFlag: CommandHandler.RangeFlag, val argumentFlag: CommandHandler.ArgumentFlag, val access: CommandHandler.Access, - val flags: Set + val flags: Set, ) diff --git a/src/com/maddyhome/idea/vim/ex/CommandParser.kt b/src/com/maddyhome/idea/vim/ex/CommandParser.kt index 08e46051f0..1ff84f37f0 100644 --- a/src/com/maddyhome/idea/vim/ex/CommandParser.kt +++ b/src/com/maddyhome/idea/vim/ex/CommandParser.kt @@ -108,7 +108,7 @@ object CommandParser { context: DataContext, cmd: String, count: Int, - aliasCountdown: Int + aliasCountdown: Int, ) { // Nothing entered if (cmd.isEmpty()) { diff --git a/src/com/maddyhome/idea/vim/ex/handler/BufferListHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/BufferListHandler.kt index a05b8b3661..17d28891eb 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/BufferListHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/BufferListHandler.kt @@ -121,7 +121,7 @@ private fun getBufferStatus( editor: Editor, file: VirtualFile, currentFile: VirtualFile, - previousFile: VirtualFile? + previousFile: VirtualFile?, ): String { @NonNls val bufStatus = StringBuilder() diff --git a/src/com/maddyhome/idea/vim/ex/handler/DeleteLinesHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/DeleteLinesHandler.kt index f1fcb4d402..d86d186b1b 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/DeleteLinesHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/DeleteLinesHandler.kt @@ -36,7 +36,7 @@ class DeleteLinesHandler : CommandHandler.ForEachCaret() { editor: Editor, caret: Caret, context: DataContext, - cmd: ExCommand + cmd: ExCommand, ): Boolean { val argument = cmd.argument val register = if (argument.isNotEmpty() && !argument[0].isDigit()) { diff --git a/src/com/maddyhome/idea/vim/ex/handler/MoveTextHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/MoveTextHandler.kt index ec6c6ee1d3..6b373587d8 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/MoveTextHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/MoveTextHandler.kt @@ -93,7 +93,7 @@ class MoveTextHandler : CommandHandler.SingleExecution() { editor: Editor, caret: Caret, command: ExCommand, - lineRange: LineRange + lineRange: LineRange, ): Int { var line = command.ranges.getFirstLine(editor, caret) val adj = lineRange.endLine - lineRange.startLine + 1 diff --git a/src/com/maddyhome/idea/vim/ex/handler/SortHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/SortHandler.kt index fbbf62bc5c..695bfd12af 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/SortHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/SortHandler.kt @@ -98,7 +98,7 @@ class SortHandler : CommandHandler.SingleExecution() { private class LineComparator( private val myIgnoreCase: Boolean, private val myNumber: Boolean, - private val myReverse: Boolean + private val myReverse: Boolean, ) : Comparator { override fun compare(o1: String, o2: String): Int { diff --git a/src/com/maddyhome/idea/vim/ex/handler/mapping/CommandInfo.kt b/src/com/maddyhome/idea/vim/ex/handler/mapping/CommandInfo.kt index ca07007346..3b3273e520 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/mapping/CommandInfo.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/mapping/CommandInfo.kt @@ -25,7 +25,7 @@ internal class CommandInfo( @NonNls val prefix: String, @NonNls suffix: String, val mappingModes: Set, - val isRecursive: Boolean + val isRecursive: Boolean, ) { val command = if (suffix.isBlank()) prefix else "$prefix[$suffix]" } diff --git a/src/com/maddyhome/idea/vim/ex/handler/mapping/MapHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/mapping/MapHandler.kt index 5387a9e4b7..aadcd4a5f8 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/mapping/MapHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/mapping/MapHandler.kt @@ -113,7 +113,7 @@ class MapHandler : CommandHandler.SingleExecution(), VimScriptCommandHandler, Co private class CommandArguments( val specialArguments: Set, val fromKeys: List, - val toKeys: List + val toKeys: List, ) companion object { diff --git a/src/com/maddyhome/idea/vim/ex/ranges/ExRanges.kt b/src/com/maddyhome/idea/vim/ex/ranges/ExRanges.kt index ef5e5de434..66c424c629 100644 --- a/src/com/maddyhome/idea/vim/ex/ranges/ExRanges.kt +++ b/src/com/maddyhome/idea/vim/ex/ranges/ExRanges.kt @@ -32,7 +32,7 @@ import java.util.* sealed class Range( // Line offset protected val offset: Int, - val isMove: Boolean + val isMove: Boolean, ) { /** * Gets the line number (0 based) specificied by this range. Includes the offset. @@ -146,7 +146,7 @@ class LineNumberRange : Range { override fun getRangeLine( editor: Editor, caret: Caret, - lastZero: Boolean + lastZero: Boolean, ): Int { line = if (line == LAST_LINE) EditorHelper.getLineCount(editor) - 1 else caret.logicalPosition.line return line @@ -239,7 +239,7 @@ class SearchRange(pattern: String, offset: Int, move: Boolean) : Range(offset, m */ override fun getRangeLine( editor: Editor, - lastZero: Boolean + lastZero: Boolean, ): Int { // Each subsequent pattern is searched for starting in the line after the previous search match return getRangeLine(editor, editor.caretModel.currentCaret, lastZero) } @@ -247,7 +247,7 @@ class SearchRange(pattern: String, offset: Int, move: Boolean) : Range(offset, m override fun getRangeLine( editor: Editor, caret: Caret, - lastZero: Boolean + lastZero: Boolean, ): Int { var line = caret.logicalPosition.line var searchOffset = -1 diff --git a/src/com/maddyhome/idea/vim/extension/VimExtensionFacade.kt b/src/com/maddyhome/idea/vim/extension/VimExtensionFacade.kt index 8ea51af102..c019737b37 100644 --- a/src/com/maddyhome/idea/vim/extension/VimExtensionFacade.kt +++ b/src/com/maddyhome/idea/vim/extension/VimExtensionFacade.kt @@ -50,7 +50,7 @@ object VimExtensionFacade { fromKeys: List, pluginOwner: MappingOwner, extensionHandler: VimExtensionHandler, - recursive: Boolean + recursive: Boolean, ) { VimPlugin.getKey().putKeyMapping(modes, fromKeys, pluginOwner, extensionHandler, recursive) } @@ -62,7 +62,7 @@ object VimExtensionFacade { fromKeys: List, pluginOwner: MappingOwner, toKeys: List, - recursive: Boolean + recursive: Boolean, ) { VimPlugin.getKey().putKeyMapping(modes, fromKeys, pluginOwner, toKeys, recursive) } @@ -74,7 +74,7 @@ object VimExtensionFacade { fromKeys: List, pluginOwner: MappingOwner, toKeys: List, - recursive: Boolean + recursive: Boolean, ) { val filteredModes = modes.filterNotTo(HashSet()) { VimPlugin.getKey().hasmapto(it, toKeys) } VimPlugin.getKey().putKeyMapping(filteredModes, fromKeys, pluginOwner, toKeys, recursive) diff --git a/src/com/maddyhome/idea/vim/extension/surround/VimSurroundExtension.kt b/src/com/maddyhome/idea/vim/extension/surround/VimSurroundExtension.kt index a8676a47ce..eab765fe8f 100644 --- a/src/com/maddyhome/idea/vim/extension/surround/VimSurroundExtension.kt +++ b/src/com/maddyhome/idea/vim/extension/surround/VimSurroundExtension.kt @@ -132,7 +132,10 @@ class VimSurroundExtension : VimExtension { IdeaputDisabler().use { executeNormalWithoutMapping(StringHelper.parseKeys("\"" + REGISTER + sequence), editor) } } - private fun pasteSurround(innerValue: List, editor: Editor) { // This logic is direct from vim-surround + private fun pasteSurround( + innerValue: List, + editor: Editor, + ) { // This logic is direct from vim-surround val offset = editor.caretModel.offset val lineEndOffset = EditorHelper.getLineEndForOffset(editor, offset) val motionEndMark = VimPlugin.getMark().getMark(editor, ']') @@ -230,7 +233,7 @@ class VimSurroundExtension : VimExtension { private fun inputFunctionName( editor: Editor, - withInternalSpaces: Boolean + withInternalSpaces: Boolean, ): Pair? { val functionNameInput = inputString(editor, "function: ", null) if (functionNameInput.isEmpty()) return null diff --git a/src/com/maddyhome/idea/vim/group/NotificationService.kt b/src/com/maddyhome/idea/vim/group/NotificationService.kt index 897c352821..de6541ef92 100644 --- a/src/com/maddyhome/idea/vim/group/NotificationService.kt +++ b/src/com/maddyhome/idea/vim/group/NotificationService.kt @@ -269,7 +269,7 @@ class NotificationService(private val project: Project?) { val notification: Notification, val appendableText: String, val optionName: String, - val enableOption: () -> Unit + val enableOption: () -> Unit, ) : AnAction("Append to ~/.ideavimrc") { override fun actionPerformed(e: AnActionEvent) { val eventProject = e.project diff --git a/src/com/maddyhome/idea/vim/group/copy/PutGroup.kt b/src/com/maddyhome/idea/vim/group/copy/PutGroup.kt index 65cbcc0124..36273f68ed 100644 --- a/src/com/maddyhome/idea/vim/group/copy/PutGroup.kt +++ b/src/com/maddyhome/idea/vim/group/copy/PutGroup.kt @@ -66,27 +66,27 @@ data class PutData( val insertTextBeforeCaret: Boolean, private val rawIndent: Boolean, val caretAfterInsertedText: Boolean, - val putToLine: Int = -1 + val putToLine: Int = -1, ) { val indent: Boolean = if (rawIndent && textData?.typeInRegister != SelectionType.LINE_WISE && visualSelection?.typeInEditor != SelectionType.LINE_WISE) false else rawIndent data class VisualSelection( val caretsAndSelections: Map, - val typeInEditor: SelectionType + val typeInEditor: SelectionType, ) data class TextData( val rawText: String?, val typeInRegister: SelectionType, - val transferableData: List + val transferableData: List, ) } private data class ProcessedTextData( val text: String, val typeInRegister: SelectionType, - val transferableData: List + val transferableData: List, ) class PutGroup { @@ -158,7 +158,7 @@ class PutGroup { context: DataContext, text: ProcessedTextData, data: PutData, - additionalData: Map + additionalData: Map, ) { val subMode = data.visualSelection?.typeInEditor?.toSubMode() ?: CommandState.SubMode.NONE if (ClipboardOptionsData.ideaput in OptionsManager.clipboard) { @@ -188,7 +188,7 @@ class PutGroup { data: PutData, additionalData: Map, context: DataContext, - text: ProcessedTextData + text: ProcessedTextData, ) { if (data.visualSelection?.typeInEditor?.isLine == true && editor.isOneLineMode) return val startOffsets = prepareDocumentAndGetStartOffsets(editor, caret, text.typeInRegister, data, additionalData) @@ -217,7 +217,7 @@ class PutGroup { caret: Caret, typeInRegister: SelectionType, data: PutData, - additionalData: Map + additionalData: Map, ): List { val application = ApplicationManager.getApplication() if (data.visualSelection != null) { @@ -294,7 +294,7 @@ class PutGroup { private fun getProviderForPasteViaIde( context: DataContext, typeInRegister: SelectionType, - data: PutData + data: PutData, ): PasteProvider? { if (data.visualSelection != null && data.visualSelection.typeInEditor.isBlock) return null if ((typeInRegister.isLine || typeInRegister.isChar) && data.count == 1) { @@ -311,7 +311,7 @@ class PutGroup { text: ProcessedTextData, subMode: CommandState.SubMode, data: PutData, - additionalData: Map + additionalData: Map, ) { val carets: MutableMap = mutableMapOf() EditorHelper.getOrderedCaretsList(editor).forEach { caret -> @@ -382,7 +382,7 @@ class PutGroup { startOffset: Int, count: Int, indent: Boolean, - cursorAfter: Boolean + cursorAfter: Boolean, ): Int = when (type) { SelectionType.CHARACTER_WISE -> putTextCharacterwise( @@ -422,7 +422,7 @@ class PutGroup { startOffset: Int, count: Int, indent: Boolean, - cursorAfter: Boolean + cursorAfter: Boolean, ): Int { val caretModel = editor.caretModel val overlappedCarets = ArrayList(caretModel.caretCount) @@ -461,7 +461,7 @@ class PutGroup { startOffset: Int, count: Int, indent: Boolean, - cursorAfter: Boolean + cursorAfter: Boolean, ): Int { val startPosition = editor.offsetToLogicalPosition(startOffset) val currentColumn = if (mode == CommandState.SubMode.VISUAL_LINE) 0 else startPosition.column @@ -530,7 +530,7 @@ class PutGroup { startOffset: Int, count: Int, indent: Boolean, - cursorAfter: Boolean + cursorAfter: Boolean, ): Int { MotionGroup.moveCaret(editor, caret, startOffset) val insertedText = text.repeat(count) @@ -552,7 +552,7 @@ class PutGroup { endOffset: Int, typeInRegister: SelectionType, modeInEditor: CommandState.SubMode, - caretAfterInsertedText: Boolean + caretAfterInsertedText: Boolean, ) { val cursorMode = when (typeInRegister) { SelectionType.BLOCK_WISE -> when (modeInEditor) { diff --git a/src/com/maddyhome/idea/vim/group/copy/YankGroup.kt b/src/com/maddyhome/idea/vim/group/copy/YankGroup.kt index e8bc50c15d..0ce906c053 100644 --- a/src/com/maddyhome/idea/vim/group/copy/YankGroup.kt +++ b/src/com/maddyhome/idea/vim/group/copy/YankGroup.kt @@ -185,7 +185,7 @@ class YankGroup { editor: Editor, range: TextRange, type: SelectionType, - startOffsets: Map? + startOffsets: Map?, ): Boolean { startOffsets?.forEach { (caret, offset) -> MotionGroup.moveCaret(editor, caret, offset) } diff --git a/src/com/maddyhome/idea/vim/group/visual/IdeaSelectionControl.kt b/src/com/maddyhome/idea/vim/group/visual/IdeaSelectionControl.kt index 0b841a1db6..d0f8123410 100644 --- a/src/com/maddyhome/idea/vim/group/visual/IdeaSelectionControl.kt +++ b/src/com/maddyhome/idea/vim/group/visual/IdeaSelectionControl.kt @@ -52,7 +52,7 @@ object IdeaSelectionControl { */ fun controlNonVimSelectionChange( editor: Editor, - selectionSource: VimListenerManager.SelectionSource = VimListenerManager.SelectionSource.OTHER + selectionSource: VimListenerManager.SelectionSource = VimListenerManager.SelectionSource.OTHER, ) { VimVisualTimer.singleTask(editor.mode) { initialMode -> @@ -138,7 +138,7 @@ object IdeaSelectionControl { private fun chooseSelectionMode( editor: Editor, selectionSource: VimListenerManager.SelectionSource, - logReason: Boolean + logReason: Boolean, ): CommandState.Mode { return when { editor.isOneLineMode -> { diff --git a/src/com/maddyhome/idea/vim/group/visual/VimSelection.kt b/src/com/maddyhome/idea/vim/group/visual/VimSelection.kt index 3e4f78360d..b3350491d9 100644 --- a/src/com/maddyhome/idea/vim/group/visual/VimSelection.kt +++ b/src/com/maddyhome/idea/vim/group/visual/VimSelection.kt @@ -114,7 +114,7 @@ sealed class VimSimpleSelection : VimSelection() { nativeStart: Int, nativeEnd: Int, type: SelectionType, - editor: Editor + editor: Editor, ) = when (type) { CHARACTER_WISE -> VimCharacterSelection(vimStart, vimEnd, nativeStart, nativeEnd, editor) @@ -129,7 +129,7 @@ class VimCharacterSelection( override val vimEnd: Int, override val nativeStart: Int, override val nativeEnd: Int, - override val editor: Editor + override val editor: Editor, ) : VimSimpleSelection() { override val normNativeStart = min(nativeStart, nativeEnd) override val normNativeEnd = max(nativeStart, nativeEnd) @@ -143,7 +143,7 @@ class VimLineSelection( override val vimEnd: Int, override val nativeStart: Int, override val nativeEnd: Int, - override val editor: Editor + override val editor: Editor, ) : VimSimpleSelection() { override val normNativeStart = min(nativeStart, nativeEnd) override val normNativeEnd = max(nativeStart, nativeEnd) @@ -161,7 +161,7 @@ class VimBlockSelection( override val vimStart: Int, override val vimEnd: Int, override val editor: Editor, - private val toLineEnd: Boolean + private val toLineEnd: Boolean, ) : VimSelection() { override fun getNativeStartAndEnd() = blockToNativeSelection(editor, vimStart, vimEnd, CommandState.Mode.VISUAL).let { editor.logicalPositionToOffset(it.first) to editor.logicalPositionToOffset(it.second) diff --git a/src/com/maddyhome/idea/vim/group/visual/VisualGroup.kt b/src/com/maddyhome/idea/vim/group/visual/VisualGroup.kt index 648abe8efd..b19e42a8f7 100644 --- a/src/com/maddyhome/idea/vim/group/visual/VisualGroup.kt +++ b/src/com/maddyhome/idea/vim/group/visual/VisualGroup.kt @@ -199,7 +199,7 @@ fun blockToNativeSelection( editor: Editor, start: Int, end: Int, - mode: CommandState.Mode + mode: CommandState.Mode, ): Pair { var blockStart = editor.offsetToLogicalPosition(start) var blockEnd = editor.offsetToLogicalPosition(end) diff --git a/src/com/maddyhome/idea/vim/handler/ChangeEditorActionHandler.kt b/src/com/maddyhome/idea/vim/handler/ChangeEditorActionHandler.kt index a59b6ea93b..3bdcf49751 100644 --- a/src/com/maddyhome/idea/vim/handler/ChangeEditorActionHandler.kt +++ b/src/com/maddyhome/idea/vim/handler/ChangeEditorActionHandler.kt @@ -53,7 +53,7 @@ sealed class ChangeEditorActionHandler : EditorActionHandlerBase(false) { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Boolean } diff --git a/src/com/maddyhome/idea/vim/handler/MotionActionHandler.kt b/src/com/maddyhome/idea/vim/handler/MotionActionHandler.kt index 171b051fa7..6cc45551e0 100644 --- a/src/com/maddyhome/idea/vim/handler/MotionActionHandler.kt +++ b/src/com/maddyhome/idea/vim/handler/MotionActionHandler.kt @@ -65,7 +65,7 @@ sealed class MotionActionHandler : EditorActionHandlerBase(false) { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion /** @@ -134,7 +134,7 @@ sealed class MotionActionHandler : EditorActionHandlerBase(false) { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { return when (this) { is SingleExecution -> getOffset(editor, context, count, rawCount, argument) diff --git a/src/com/maddyhome/idea/vim/handler/SpecialKeyHandlers.kt b/src/com/maddyhome/idea/vim/handler/SpecialKeyHandlers.kt index 77647d2296..e41f068caa 100644 --- a/src/com/maddyhome/idea/vim/handler/SpecialKeyHandlers.kt +++ b/src/com/maddyhome/idea/vim/handler/SpecialKeyHandlers.kt @@ -124,7 +124,7 @@ abstract class NonShiftedSpecialKeyHandler : MotionActionHandler.ForEachCaret() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Motion { val keymodel = OptionsManager.keymodel if (editor.inSelectMode && (KeyModelOptionData.stopsel in keymodel || KeyModelOptionData.stopselect in keymodel)) { @@ -146,6 +146,6 @@ abstract class NonShiftedSpecialKeyHandler : MotionActionHandler.ForEachCaret() context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): Int } diff --git a/src/com/maddyhome/idea/vim/handler/TextObjectActionHandler.kt b/src/com/maddyhome/idea/vim/handler/TextObjectActionHandler.kt index 42a793e95e..2b3a1f09e4 100644 --- a/src/com/maddyhome/idea/vim/handler/TextObjectActionHandler.kt +++ b/src/com/maddyhome/idea/vim/handler/TextObjectActionHandler.kt @@ -59,7 +59,7 @@ abstract class TextObjectActionHandler : EditorActionHandlerBase(true) { context: DataContext, count: Int, rawCount: Int, - argument: Argument? + argument: Argument?, ): TextRange? /** diff --git a/src/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt b/src/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt index c9e5af9d8a..5f946692c6 100644 --- a/src/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt +++ b/src/com/maddyhome/idea/vim/handler/VisualOperatorActionHandler.kt @@ -79,7 +79,7 @@ sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false) { caret: Caret, context: DataContext, cmd: Command, - range: VimSelection + range: VimSelection, ): Boolean /** @@ -91,7 +91,7 @@ sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false) { editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ) = true /** @@ -119,7 +119,7 @@ sealed class VisualOperatorActionHandler : EditorActionHandlerBase(false) { editor: Editor, context: DataContext, cmd: Command, - caretsAndSelections: Map + caretsAndSelections: Map, ): Boolean } diff --git a/src/com/maddyhome/idea/vim/helper/EditorDataContext.kt b/src/com/maddyhome/idea/vim/helper/EditorDataContext.kt index f383c7c479..dee0a7d92e 100644 --- a/src/com/maddyhome/idea/vim/helper/EditorDataContext.kt +++ b/src/com/maddyhome/idea/vim/helper/EditorDataContext.kt @@ -23,7 +23,7 @@ import com.intellij.openapi.editor.Editor class EditorDataContext @Deprecated("Please use `init` method") constructor( private val editor: Editor, - private val contextDelegate: DataContext? = null + private val contextDelegate: DataContext? = null, ) : DataContext { /** * Returns the object corresponding to the specified data identifier. Some of the supported data identifiers are diff --git a/src/com/maddyhome/idea/vim/helper/Helper.kt b/src/com/maddyhome/idea/vim/helper/Helper.kt index bcb3762ff7..9bd3a73d01 100644 --- a/src/com/maddyhome/idea/vim/helper/Helper.kt +++ b/src/com/maddyhome/idea/vim/helper/Helper.kt @@ -65,7 +65,7 @@ import java.util.* annotation class VimBehaviorDiffers( val originalVimAfter: String = "", val description: String = "", - val shouldBeFixed: Boolean = true + val shouldBeFixed: Boolean = true, ) fun > sort(a: T, b: T) = if (a > b) b to a else a to b @@ -95,11 +95,13 @@ fun localEditors(): List { } fun localEditors(doc: Document): List { - return EditorFactory.getInstance().getEditors(doc).filter { editor -> editor.editorClientId.let { it == null || it == ClientId.currentOrNull } } + return EditorFactory.getInstance().getEditors(doc) + .filter { editor -> editor.editorClientId.let { it == null || it == ClientId.currentOrNull } } } fun localEditors(doc: Document, project: Project): List { - return EditorFactory.getInstance().getEditors(doc, project).filter { editor -> editor.editorClientId.let { it == null || it == ClientId.currentOrNull } } + return EditorFactory.getInstance().getEditors(doc, project) + .filter { editor -> editor.editorClientId.let { it == null || it == ClientId.currentOrNull } } } val Editor.editorClientId: ClientId? diff --git a/src/com/maddyhome/idea/vim/helper/SearchHighlightsHelper.kt b/src/com/maddyhome/idea/vim/helper/SearchHighlightsHelper.kt index 7ab83b30c2..801b81a1d2 100644 --- a/src/com/maddyhome/idea/vim/helper/SearchHighlightsHelper.kt +++ b/src/com/maddyhome/idea/vim/helper/SearchHighlightsHelper.kt @@ -44,7 +44,7 @@ fun updateSearchHighlights( pattern: String?, shouldIgnoreSmartCase: Boolean, showHighlights: Boolean, - forceUpdate: Boolean + forceUpdate: Boolean, ) { updateSearchHighlights(pattern, shouldIgnoreSmartCase, showHighlights, -1, null, true, forceUpdate) } @@ -54,7 +54,7 @@ fun updateIncsearchHighlights( pattern: String, forwards: Boolean, caretOffset: Int, - searchRange: LineRange? + searchRange: LineRange?, ): Int { val searchStartOffset = if (searchRange != null) EditorHelper.getLineStartOffset(editor, searchRange.startLine) else caretOffset @@ -85,7 +85,7 @@ private fun updateSearchHighlights( initialOffset: Int, searchRange: LineRange?, forwards: Boolean, - forceUpdate: Boolean + forceUpdate: Boolean, ): Int { var currentMatchOffset = -1 val projectManager = ProjectManager.getInstanceIfCreated() ?: return currentMatchOffset diff --git a/src/com/maddyhome/idea/vim/key/MappingInfo.kt b/src/com/maddyhome/idea/vim/key/MappingInfo.kt index 6ded092633..f58385e9af 100644 --- a/src/com/maddyhome/idea/vim/key/MappingInfo.kt +++ b/src/com/maddyhome/idea/vim/key/MappingInfo.kt @@ -85,7 +85,7 @@ class ToKeysMappingInfo( val toKeys: List, fromKeys: List, isRecursive: Boolean, - owner: MappingOwner + owner: MappingOwner, ) : MappingInfo(fromKeys, isRecursive, owner) { override fun getPresentableString(): String = toKeyNotation(toKeys) @@ -106,7 +106,7 @@ class ToHandlerMappingInfo( private val extensionHandler: VimExtensionHandler, fromKeys: List, isRecursive: Boolean, - owner: MappingOwner + owner: MappingOwner, ) : MappingInfo(fromKeys, isRecursive, owner) { override fun getPresentableString(): String = "call ${extensionHandler.javaClass.canonicalName}" @@ -176,7 +176,7 @@ class ToActionMappingInfo( val action: String, fromKeys: List, isRecursive: Boolean, - owner: MappingOwner + owner: MappingOwner, ) : MappingInfo(fromKeys, isRecursive, owner) { override fun getPresentableString(): String = "action $action" diff --git a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt index aaf70339c2..2d212d3ade 100644 --- a/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt +++ b/src/com/maddyhome/idea/vim/key/ShortcutOwner.kt @@ -30,7 +30,7 @@ sealed class ShortcutOwnerInfo { val normal: ShortcutOwner, val insert: ShortcutOwner, val visual: ShortcutOwner, - val select: ShortcutOwner + val select: ShortcutOwner, ) : ShortcutOwnerInfo() { fun toNotation(): String { val owners = HashMultimap.create() diff --git a/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt b/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt index 983f375a4b..66db70990d 100644 --- a/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt +++ b/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt @@ -110,10 +110,10 @@ object IdeaSpecifics { //region Enter insert mode after surround with if if (surrounderAction == action.javaClass.name && surrounderItems.any { - action.templatePresentation.text.endsWith( + action.templatePresentation.text.endsWith( it ) - } + } ) { editor?.let { val commandState = it.commandState @@ -151,7 +151,7 @@ object IdeaSpecifics { templateState: TemplateState, template: Template?, oldIndex: Int, - newIndex: Int + newIndex: Int, ) { if (IdeaRefactorMode.keepMode()) { IdeaRefactorMode.correctSelection(editor) @@ -228,7 +228,7 @@ object IdeaSpecifics { fun onMovement( editor: @NotNull Editor, caret: @NotNull Caret, - toRight: Boolean + toRight: Boolean, ) { if (!PlatformUtils.isAppCode()) return diff --git a/src/com/maddyhome/idea/vim/ui/StatusBar.kt b/src/com/maddyhome/idea/vim/ui/StatusBar.kt index 21cbce57a0..55d15ee5b7 100644 --- a/src/com/maddyhome/idea/vim/ui/StatusBar.kt +++ b/src/com/maddyhome/idea/vim/ui/StatusBar.kt @@ -218,7 +218,7 @@ private class HelpLink( /*@ActionText*/ name: String, val link: String, - icon: Icon? + icon: Icon?, ) : DumbAwareAction(name, null, icon)/*, LightEditCompatible*/ { override fun actionPerformed(e: AnActionEvent) { BrowserUtil.browse(link) diff --git a/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt b/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt index f22e04d443..af4ce7c06c 100644 --- a/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt +++ b/src/com/maddyhome/idea/vim/ui/ex/ExEditorKit.kt @@ -31,6 +31,45 @@ import javax.swing.text.Document import javax.swing.text.TextAction object ExEditorKit : DefaultEditorKit() { + + @NonNls + val CancelEntry: String = "cancel-entry" + + @NonNls + val CompleteEntry: String = "complete-entry" + + @NonNls + val EscapeChar: String = "escape" + + @NonNls + val DeleteToCursor: String = "delete-to-cursor" + + @NonNls + val ToggleInsertReplace: String = "toggle-insert" + + @NonNls + val InsertRegister: String = "insert-register" + + @NonNls + val HistoryUp: String = "history-up" + + @NonNls + val HistoryDown: String = "history-down" + + @NonNls + val HistoryUpFilter: String = "history-up-filter" + + @NonNls + val HistoryDownFilter: String = "history-down-filter" + + @NonNls + val StartDigraph: String = "start-digraph" + + @NonNls + val StartLiteral: String = "start-literal" + + private val logger = logger() + /** * Gets the MIME type of the data that this * kit represents support for. @@ -125,42 +164,4 @@ object ExEditorKit : DefaultEditorKit() { } return null } - - @NonNls - val CancelEntry: String = "cancel-entry" - - @NonNls - val CompleteEntry: String = "complete-entry" - - @NonNls - val EscapeChar: String = "escape" - - @NonNls - val DeleteToCursor: String = "delete-to-cursor" - - @NonNls - val ToggleInsertReplace: String = "toggle-insert" - - @NonNls - val InsertRegister: String = "insert-register" - - @NonNls - val HistoryUp: String = "history-up" - - @NonNls - val HistoryDown: String = "history-down" - - @NonNls - val HistoryUpFilter: String = "history-up-filter" - - @NonNls - val HistoryDownFilter: String = "history-down-filter" - - @NonNls - val StartDigraph: String = "start-digraph" - - @NonNls - val StartLiteral: String = "start-literal" - - private val logger = logger() } diff --git a/test/org/jetbrains/plugins/ideavim/NeovimTesting.kt b/test/org/jetbrains/plugins/ideavim/NeovimTesting.kt index bdc986b979..0ea3fb2a9d 100644 --- a/test/org/jetbrains/plugins/ideavim/NeovimTesting.kt +++ b/test/org/jetbrains/plugins/ideavim/NeovimTesting.kt @@ -156,6 +156,7 @@ annotation class TestWithoutNeovim(val reason: SkipNeovimReason, val description enum class SkipNeovimReason { PLUGIN, MULTICARET, + @Suppress("unused") INLAYS, OPTION, diff --git a/test/org/jetbrains/plugins/ideavim/TestHelper.kt b/test/org/jetbrains/plugins/ideavim/TestHelper.kt index 393a8595e2..ca5d2402ca 100644 --- a/test/org/jetbrains/plugins/ideavim/TestHelper.kt +++ b/test/org/jetbrains/plugins/ideavim/TestHelper.kt @@ -75,7 +75,7 @@ inline fun waitAndAssert(timeInMillis: Int = 1000, condition: () -> Boolean) { fun waitAndAssertMode( fixture: CodeInsightTestFixture, mode: CommandState.Mode, - timeInMillis: Int = OptionsManager.visualEnterDelay.value() + 1000 + timeInMillis: Int = OptionsManager.visualEnterDelay.value() + 1000, ) { waitAndAssert(timeInMillis) { fixture.editor.mode == mode } } @@ -102,7 +102,7 @@ fun assertHappened(timeInMillis: Int = 1000, precision: Int, condition: () -> Bo fun waitCondition( durationMillis: Long, interval: Long = 500, - condition: () -> Boolean + condition: () -> Boolean, ): Boolean { val endTime = System.currentTimeMillis() + durationMillis while (System.currentTimeMillis() < endTime) { diff --git a/test/org/jetbrains/plugins/ideavim/VimOptionTestCase.kt b/test/org/jetbrains/plugins/ideavim/VimOptionTestCase.kt index beec3d017f..2f743e80f4 100644 --- a/test/org/jetbrains/plugins/ideavim/VimOptionTestCase.kt +++ b/test/org/jetbrains/plugins/ideavim/VimOptionTestCase.kt @@ -106,7 +106,7 @@ annotation class VimOptionTestConfiguration(vararg val value: VimTestOption) annotation class VimTestOption( val option: String, val type: VimTestOptionType, - val values: Array + val values: Array, ) enum class VimTestOptionType { diff --git a/test/org/jetbrains/plugins/ideavim/VimTestCase.kt b/test/org/jetbrains/plugins/ideavim/VimTestCase.kt index 82a357c6e9..56c09dac16 100644 --- a/test/org/jetbrains/plugins/ideavim/VimTestCase.kt +++ b/test/org/jetbrains/plugins/ideavim/VimTestCase.kt @@ -422,7 +422,7 @@ abstract class VimTestCase : UsefulTestCase() { fun doTest( keys: List, before: String, - after: String + after: String, ) { doTest(keys, before, after, CommandState.Mode.COMMAND, SubMode.NONE) } @@ -432,7 +432,7 @@ abstract class VimTestCase : UsefulTestCase() { before: String, after: String, modeAfter: CommandState.Mode, - subModeAfter: SubMode + subModeAfter: SubMode, ) { doTest(keys.joinToString(separator = ""), before, after, modeAfter, subModeAfter) } @@ -442,7 +442,7 @@ abstract class VimTestCase : UsefulTestCase() { before: String, after: String, modeAfter: CommandState.Mode, - subModeAfter: SubMode + subModeAfter: SubMode, ) { configureByText(before) @@ -466,7 +466,7 @@ abstract class VimTestCase : UsefulTestCase() { after: String?, modeAfter: CommandState.Mode, subModeAfter: SubMode, - afterEditorInitialized: (Editor) -> Unit + afterEditorInitialized: (Editor) -> Unit, ) { configureByText(before) afterEditorInitialized(myFixture.editor) diff --git a/test/ui/pages/ActionMenuFixture.kt b/test/ui/pages/ActionMenuFixture.kt index 4e8464dcdd..b3d83c0924 100644 --- a/test/ui/pages/ActionMenuFixture.kt +++ b/test/ui/pages/ActionMenuFixture.kt @@ -44,11 +44,11 @@ fun RemoteRobot.actionMenuItem(text: String): ActionMenuItemFixture { @FixtureName("ActionMenu") class ActionMenuFixture( remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent + remoteComponent: RemoteComponent, ) : ComponentFixture(remoteRobot, remoteComponent) @FixtureName("ActionMenuItem") class ActionMenuItemFixture( remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent + remoteComponent: RemoteComponent, ) : ComponentFixture(remoteRobot, remoteComponent) diff --git a/test/ui/pages/DialogFixture.kt b/test/ui/pages/DialogFixture.kt index ff56b26836..501dc18199 100644 --- a/test/ui/pages/DialogFixture.kt +++ b/test/ui/pages/DialogFixture.kt @@ -30,7 +30,7 @@ import java.time.Duration fun ContainerFixture.dialog( title: String, timeout: Duration = Duration.ofSeconds(20), - function: DialogFixture.() -> Unit = {} + function: DialogFixture.() -> Unit = {}, ): DialogFixture = step("Search for dialog with title $title") { find(DialogFixture.byTitle(title), timeout).apply(function) } @@ -38,7 +38,7 @@ fun ContainerFixture.dialog( @FixtureName("Dialog") class DialogFixture( remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent + remoteComponent: RemoteComponent, ) : CommonContainerFixture(remoteRobot, remoteComponent) { companion object { diff --git a/test/ui/pages/Editor.kt b/test/ui/pages/Editor.kt index 536eb31a83..82868f8e81 100644 --- a/test/ui/pages/Editor.kt +++ b/test/ui/pages/Editor.kt @@ -43,7 +43,7 @@ fun ContainerFixture.editor(title: String, function: Editor.() -> Unit = {}): Ed @FixtureName("Editor") class Editor( remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent + remoteComponent: RemoteComponent, ) : CommonContainerFixture(remoteRobot, remoteComponent) { val text: String get() = callJs("component.getEditor().getDocument().getText()", true) diff --git a/test/ui/pages/Gutter.kt b/test/ui/pages/Gutter.kt index b6fe819440..9e18b71df2 100644 --- a/test/ui/pages/Gutter.kt +++ b/test/ui/pages/Gutter.kt @@ -37,5 +37,5 @@ fun ContainerFixture.gutter(function: Gutter.() -> Unit = {}): ContainerFixture @FixtureName("Gutter") class Gutter( remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent + remoteComponent: RemoteComponent, ) : CommonContainerFixture(remoteRobot, remoteComponent) diff --git a/test/ui/pages/IdeaFrame.kt b/test/ui/pages/IdeaFrame.kt index eef1b9cd81..f1336acfca 100644 --- a/test/ui/pages/IdeaFrame.kt +++ b/test/ui/pages/IdeaFrame.kt @@ -37,7 +37,7 @@ fun RemoteRobot.idea(function: IdeaFrame.() -> Unit) { @DefaultXpath("IdeFrameImpl type", "//div[@class='IdeFrameImpl']") class IdeaFrame( remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent + remoteComponent: RemoteComponent, ) : CommonContainerFixture(remoteRobot, remoteComponent) { val projectViewTree diff --git a/test/ui/pages/WelcomeFrame.kt b/test/ui/pages/WelcomeFrame.kt index 66e8e5a85a..51657a6867 100644 --- a/test/ui/pages/WelcomeFrame.kt +++ b/test/ui/pages/WelcomeFrame.kt @@ -42,6 +42,7 @@ class WelcomeFrame(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : "//div[(@class='MainButton' and @text='New Project') or (@accessiblename='New Project' and @class='JButton')]" ) ) + @Suppress("unused") val moreActions get() = button(byXpath("More Action", "//div[@accessiblename='More Actions' and @class='ActionButton']")) From bb5632c98d3d4fbd73cb8a057cf3aa28a8534caf Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 19:36:33 +0300 Subject: [PATCH 26/34] Update ktlint and detekt formatting --- .detekt/baseline.xml | 19 +++++++++---------- .../idea/vim/listener/IdeaSpecifics.kt | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.detekt/baseline.xml b/.detekt/baseline.xml index 9c5b426776..23c0e3c0e7 100644 --- a/.detekt/baseline.xml +++ b/.detekt/baseline.xml @@ -1,18 +1,18 @@ - + ComplexMethod:CmdHandler.kt$CmdHandler$private fun addAlias(cmd: ExCommand, editor: Editor?): Boolean ComplexMethod:CommandState.kt$CommandState$ fun toVimNotation(): String - ComplexCondition:CommandParser.kt$CommandParser$Character.isLetter(ch) || command.isEmpty() && "~<>@=#*&!".indexOf(ch) >= 0 || command.isNotEmpty() && ch == command[command.length - 1] && "<>".indexOf(ch) >= 0 + ComplexCondition:CommandParser.kt$CommandParser$Character.isLetter(ch) || command.isEmpty() && "~<>@=#*&!".indexOf(ch) >= 0 || command.isNotEmpty() && ch == command[command.length - 1] && "<>".indexOf(ch) >= 0 ComplexMethod:CommandParser.kt$CommandParser$ @kotlin.jvm.Throws(ExException::class) fun parse(cmd: String): ExCommand ComplexMethod:HistoryHandler.kt$HistoryHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean ComplexMethod:NerdTree.kt$NerdTree$private fun registerCommands() ComplexMethod:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean - ComplexMethod:PutGroup.kt$PutGroup$private fun prepareDocumentAndGetStartOffsets( editor: Editor, caret: Caret, typeInRegister: SelectionType, data: PutData, additionalData: Map<String, Any> ): List<Int> + ComplexMethod:PutGroup.kt$PutGroup$private fun prepareDocumentAndGetStartOffsets( editor: Editor, caret: Caret, typeInRegister: SelectionType, data: PutData, additionalData: Map<String, Any>, ): List<Int> ComplexMethod:SearchHelperKt.kt$// bounds are considered inside corresponding quotes fun checkInString(chars: CharSequence, currentPos: Int, str: Boolean): Boolean - ComplexMethod:SearchHighlightsHelper.kt$ private fun updateSearchHighlights( pattern: String?, shouldIgnoreSmartCase: Boolean, showHighlights: Boolean, initialOffset: Int, searchRange: LineRange?, forwards: Boolean, forceUpdate: Boolean ): Int + ComplexMethod:SearchHighlightsHelper.kt$ private fun updateSearchHighlights( pattern: String?, shouldIgnoreSmartCase: Boolean, showHighlights: Boolean, initialOffset: Int, searchRange: LineRange?, forwards: Boolean, forceUpdate: Boolean, ): Int ComplexMethod:TabCloseHandler.kt$TabCloseHandler$ private fun getTabIndexToClose(arg: String, current: Int, last: Int): Int? ComplexMethod:VimExchangeExtension.kt$VimExchangeExtension.Operator$private fun compareExchanges(x: Exchange, y: Exchange): ExchangeCompareResult ComplexMethod:VimShortcutKeyAction.kt$VimShortcutKeyAction$private fun isEnabled(e: AnActionEvent): Boolean @@ -21,9 +21,8 @@ LongMethod:HistoryHandler.kt$HistoryHandler$override fun execute(editor: Editor, context: DataContext, cmd: ExCommand): Boolean LongMethod:NerdTree.kt$NerdTree$private fun registerCommands() LongMethod:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean - LongMethod:PutGroup.kt$PutGroup$private fun prepareDocumentAndGetStartOffsets( editor: Editor, caret: Caret, typeInRegister: SelectionType, data: PutData, additionalData: Map<String, Any> ): List<Int> + LongMethod:PutGroup.kt$PutGroup$private fun prepareDocumentAndGetStartOffsets( editor: Editor, caret: Caret, typeInRegister: SelectionType, data: PutData, additionalData: Map<String, Any>, ): List<Int> LoopWithTooManyJumpStatements:NerdTree.kt$NerdTree$while (true) { row++ val nextPath = tree.getPathForRow(row) ?: break val pathCount = nextPath.pathCount if (pathCount == currentPathCount) expectedRow = row if (pathCount < currentPathCount) break } - LoopWithTooManyJumpStatements:SearchHighlightsHelper.kt$for (project in projectManager.openProjects) { val current = FileEditorManager.getInstance(project).selectedTextEditor ?: continue // [VERSION UPDATE] 202+ Use editors val editors = localEditors(current.document, project) ?: continue for (editor in editors) { // Try to keep existing highlights if possible. Update if hlsearch has changed or if the pattern has changed. // Force update for the situations where the text is the same, but the ignore case values have changed. // E.g. Use `*` to search for a word (which ignores smartcase), then use `/<Up>` to search for the same pattern, // which will match smartcase. Or changing the smartcase/ignorecase settings if (shouldRemoveSearchHighlights(editor, pattern, showHighlights) || forceUpdate) { removeSearchHighlights(editor) } if (pattern == null) continue if (shouldAddAllSearchHighlights(editor, pattern, showHighlights)) { // hlsearch (+ incsearch/noincsearch) val startLine = searchRange?.startLine ?: 0 val endLine = searchRange?.endLine ?: -1 val results = SearchHelper.findAll(editor, pattern, startLine, endLine, shouldIgnoreCase(pattern, shouldIgnoreSmartCase)) if (results.isNotEmpty()) { currentMatchOffset = findClosestMatch(editor, results, initialOffset, forwards) highlightSearchResults(editor, pattern, results, currentMatchOffset) } editor.vimLastSearch = pattern } else if (shouldAddCurrentMatchSearchHighlight(pattern, showHighlights, initialOffset)) { // nohlsearch + incsearch val searchOptions = EnumSet.of(SearchOptions.WHOLE_FILE) if (wrapscan.isSet) searchOptions.add(SearchOptions.WRAP) if (shouldIgnoreSmartCase) searchOptions.add(SearchOptions.IGNORE_SMARTCASE) if (!forwards) searchOptions.add(SearchOptions.BACKWARDS) val result = SearchHelper.findPattern(editor, pattern, initialOffset, 1, searchOptions) if (result != null) { currentMatchOffset = result.startOffset val results = listOf(result) highlightSearchResults(editor, pattern, results, currentMatchOffset) } } else if (shouldMaintainCurrentMatchOffset(pattern, initialOffset)) { // incsearch. If nothing has changed (e.g. we've edited offset values in `/foo/e+2`) make sure we return the // current match offset so the caret remains at the current incsarch match val offset = editor.vimIncsearchCurrentMatchOffset if (offset != null) { currentMatchOffset = offset } } } } MagicNumber:ActionListHandler.kt$ActionListHandler$50 MagicNumber:AddBlockInlaysAction.kt$AddBlockInlaysAction$0.9f MagicNumber:AddBlockInlaysAction.kt$AddBlockInlaysAction$1.75f @@ -72,13 +71,13 @@ MagicNumber:VimHighlightedYank.kt$VimHighlightedYank.HighlightHandler$3 MagicNumber:VimHighlightedYank.kt$VimHighlightedYank.HighlightHandler$4 MatchingDeclarationName:CommandDefinition.kt$CommandName - MaxLineLength:ExBeanClass.kt$ExBeanClass$logger<ExBeanClass>().error("IdeaVim doesn't accept contributions to `vimActions` extension points. Please create a plugin using `VimExtension`. Plugin to blame: ${this.pluginDescriptor.pluginId}") + MaxLineLength:ExBeanClass.kt$ExBeanClass$logger<ExBeanClass>().error("IdeaVim doesn't accept contributions to `vimActions` extension points. Please create a plugin using `VimExtension`. Plugin to blame: ${this.pluginDescriptor.pluginId}") MaxLineLength:OptionsManager.kt$OptionsManager$val clipboard = addOption(ListOption(ClipboardOptionsData.name, ClipboardOptionsData.abbr, arrayOf(ClipboardOptionsData.ideaput, "autoselect,exclude:cons\\|linux"), null)) MaxLineLength:StatisticReporter.kt$StatisticReporter$val url = "https://plugins.jetbrains.com/plugins/list?pluginId=${VimPlugin.getPluginId().idString}&build=$buildNumber&pluginVersion=$version&os=$os&uuid=$uid" - MemberNameEqualsClassName:Ranges.kt$Ranges$private val ranges: MutableList<Range> = mutableListOf() + MemberNameEqualsClassName:Ranges.kt$Ranges$private val ranges: MutableList<Range> = mutableListOf() NestedBlockDepth:OptionsManager.kt$OptionsManager$ fun parseOptionLine(editor: Editor?, args: String, failOnBad: Boolean): Boolean ReturnCount:CmdHandler.kt$CmdHandler$private fun addAlias(cmd: ExCommand, editor: Editor?): Boolean - ReturnCount:ExRanges.kt$Range.Companion$ @JvmStatic fun createRange(str: String, offset: Int, move: Boolean): Array<Range>? + ReturnCount:ExRanges.kt$Range.Companion$ @JvmStatic fun createRange(str: String, offset: Int, move: Boolean): Array<Range>? ReturnCount:VimMultipleCursorsExtension.kt$VimMultipleCursorsExtension.NextOccurrenceHandler$override fun executeInWriteAction(editor: Editor, context: DataContext) ReturnCount:VimShortcutKeyAction.kt$VimShortcutKeyAction$private fun isEnabled(e: AnActionEvent): Boolean ReturnCount:VisualMotionGroup.kt$VisualMotionGroup$private fun seemsLikeBlockMode(editor: Editor): Boolean @@ -92,4 +91,4 @@ TooManyFunctions:VisualGroup.kt$com.maddyhome.idea.vim.group.visual.VisualGroup.kt TooManyFunctions:VisualMotionGroup.kt$VisualMotionGroup - + \ No newline at end of file diff --git a/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt b/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt index 66db70990d..448d447ab8 100644 --- a/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt +++ b/src/com/maddyhome/idea/vim/listener/IdeaSpecifics.kt @@ -110,10 +110,10 @@ object IdeaSpecifics { //region Enter insert mode after surround with if if (surrounderAction == action.javaClass.name && surrounderItems.any { - action.templatePresentation.text.endsWith( + action.templatePresentation.text.endsWith( it ) - } + } ) { editor?.let { val commandState = it.commandState From 790fc92916da799847ef6b69b5d55cab7ec0ffc2 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 20:58:23 +0300 Subject: [PATCH 27/34] Rename Vim Emulation to Vim in settings --- CHANGES.md | 3 +++ README.md | 4 ++-- resources/messages/IdeaVimBundle.properties | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d47db0fb33..a592962353 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,9 @@ usual beta standards. * Support `sethandler` command to configure shortcuts conflicts via `~/.ideavimrc` file. See [docs](https://jb.gg/vim-sethandler). * Support `vim-paragraph-motion` extension [VIM-2290](https://youtrack.jetbrains.com/issue/VIM-2290) | [vim-paragraph-motion](https://github.com/dbakker/vim-paragraph-motion) +### Changes: +* Rename "Vim Emulation" in settings to "Vim" + ### Fixes: * [VIM-2230](https://youtrack.jetbrains.com/issue/VIM-2230) Tweak caret position with inline rename options inlay * [VIM-2177](https://youtrack.jetbrains.com/issue/VIM-2177) Fix scrolling issues near bottom of file diff --git a/README.md b/README.md index 02cfc81eaf..d08852059d 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ See the [detailed instructions](https://www.jetbrains.com/help/idea/managing-plu - Use the `~/.ideavimrc` file as an analog of `~/.vimrc` ([learn more](#Files)). The XDG standard is supported, as well. - Shortcut conflicts can be resolved by using: - - On Linux & Windows: `File | Settings | Editor | Vim Emulation` & `File | Settings | Keymap`, - - On macOS: `Preferences | Editor | Vim Emulation` & `Preferences | Keymap`, + - On Linux & Windows: `File | Settings | Editor | Vim` & `File | Settings | Keymap`, + - On macOS: `Preferences | Editor | Vim` & `Preferences | Keymap`, - Regular Vim mappings in the `~/.ideavimrc` file. Get Early Access diff --git a/resources/messages/IdeaVimBundle.properties b/resources/messages/IdeaVimBundle.properties index e7d1b2df87..0a3b4c24ef 100644 --- a/resources/messages/IdeaVimBundle.properties +++ b/resources/messages/IdeaVimBundle.properties @@ -127,7 +127,7 @@ action.finish.eap.text=Finish EAP # Don't forget to update README if you modify this entry action.subscribe.to.eap.text=Subscribe to EAP -configurable.name.vim.emulation=Vim Emulation +configurable.name.vim.emulation=Vim configurable.keyhandler.link=Use sethandler command to configure handlers from the .ideavimrc file configurable.noneditablehandler.helper.text.with.example=Non-editable handlers are defined in .ideavimrc file. E.g. ''{0}'' for {1}. border.title.shortcut.conflicts.for.active.keymap=Shortcut Conflicts for Active Keymap From f07b6e28c1538d39340839d28e89985f4a08fa27 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 21:00:46 +0300 Subject: [PATCH 28/34] Update changelog a bit --- CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a592962353..43b34f79a5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,8 +6,8 @@ History of changes in IdeaVim for the IntelliJ platform. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project DOES NOT adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -Stable versions use X.Y format. -EAP versions use X.Y.Z format. +Stable versions use X.Y format. +EAP ([Early Access Program](https://jb.gg/ideavim-eap)) versions use X.Y.Z format. Get an Early Access From 308ab4b4f5318b8e779fe7bca8b453c5722bcd8a Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Thu, 13 May 2021 23:18:07 +0300 Subject: [PATCH 29/34] Update amount of contributors --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6969e4cb34..b98b01d2ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ [![TeamCity Build][teamcity-build-status-svg]][teamcity-build-status] -IdeaVim is an open source project created by 60+ contributors. Would you like to make it even better? That’s wonderful! +IdeaVim is an open source project created by 80+ contributors. Would you like to make it even better? That’s wonderful! This page is created to help you start contributing. And who knows, maybe in a few days this project will be brighter than ever! From df52f37b69a4f17d59ed5eecfc7493d65e65436a Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Fri, 14 May 2021 09:27:54 +0300 Subject: [PATCH 30/34] Add reset handlers action for configurable table --- .../idea/vim/ui/VimEmulationConfigurable.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index 3aa629b881..dccc0ce778 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -27,6 +27,7 @@ import com.intellij.openapi.options.Configurable; import com.intellij.openapi.ui.ComboBoxTableRenderer; import com.intellij.openapi.ui.StripeTable; +import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.ui.*; import com.intellij.ui.components.JBLabel; import com.intellij.util.containers.ContainerUtil; @@ -100,6 +101,7 @@ public VimSettingsPanel(@NotNull VimShortcutConflictsTable.Model model) { ToolbarDecorator decorator = ToolbarDecorator.createDecorator(shortcutConflictsTable); decorator.setToolbarPosition(ActionToolbarPosition.RIGHT); decorator.addExtraAction(new CopyForRcAction(model)); + decorator.addExtraAction(new ResetHandlersAction(model, shortcutConflictsTable)); final JPanel scrollPane = decorator.createPanel(); scrollPane.setBorder(new LineBorder(JBColor.border())); @@ -397,4 +399,41 @@ public void actionPerformed(@NotNull AnActionEvent e) { ClipboardHandler.setClipboardText(data, Collections.emptyList(), data); } } + + public static class ResetHandlersAction extends DumbAwareActionButton { + + private final VimShortcutConflictsTable.Model myModel; + private final VimShortcutConflictsTable myTable; + + public ResetHandlersAction(VimShortcutConflictsTable.@NotNull Model model, VimShortcutConflictsTable table) { + super("Reset Handlers", "Reset handlers", AllIcons.General.Reset); + myModel = model; + myTable = table; + } + + @Override + public void updateButton(@NotNull AnActionEvent e) { + boolean enabled = myModel.getRows().stream().anyMatch(it -> it.getOwner() instanceof ShortcutOwnerInfo.AllModes && + ((ShortcutOwnerInfo.AllModes)it.getOwner()).getOwner() != + ShortcutOwner.UNDEFINED); + e.getPresentation().setEnabled(enabled); + } + + @Override + public void actionPerformed(@NotNull AnActionEvent e) { + TableUtil.stopEditing(myTable); + for (VimShortcutConflictsTable.Row row : myModel.getRows()) { + ShortcutOwnerInfo owner = row.getOwner(); + if (owner instanceof ShortcutOwnerInfo.AllModes) { + if (((ShortcutOwnerInfo.AllModes)owner).getOwner() != ShortcutOwner.UNDEFINED) { + row.setOwner(ShortcutOwnerInfo.allUndefined); + } + } + } + + IdeFocusManager.getGlobalInstance() + .doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myTable, true)); + TableUtil.updateScroller(myTable); + } + } } From bbcfee3ad68d79c0907939968c319fe9f9bd0512 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Fri, 14 May 2021 09:38:34 +0300 Subject: [PATCH 31/34] Revert version of gradle plugin to 0.7.3 --- build.gradle.kts | 28 ++++++++++++++-------------- settings.gradle | 9 --------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d1db9c7064..7ea09bafc0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,7 +20,7 @@ plugins { java kotlin("jvm") version "1.5.0" - id("org.jetbrains.intellij") version "1.0-SNAPSHOT" + id("org.jetbrains.intellij") version "0.7.3" id("io.gitlab.arturbosch.detekt") version "1.15.0" id("org.jetbrains.changelog") version "1.1.2" @@ -104,23 +104,23 @@ sourceSets { // --- Intellij plugin intellij { - version.set(ideaVersion) - pluginName.set("IdeaVim") - updateSinceUntilBuild.set(false) - downloadSources.set(downloadIdeaSources.toBoolean()) - instrumentCode.set(instrumentPluginCode.toBoolean()) - intellijRepository.set("https://www.jetbrains.com/intellij-repository") - plugins.set(listOf("java")) + version = ideaVersion + pluginName = "IdeaVim" + updateSinceUntilBuild = false + downloadSources = downloadIdeaSources.toBoolean() + instrumentCode = instrumentPluginCode.toBoolean() + intellijRepo = "https://www.jetbrains.com/intellij-repository" + setPlugins("java") } tasks { downloadRobotServerPlugin { - version.set("0.10.0") + version = "0.10.0" } publishPlugin { - channels.set(publishChannels.split(",")) - token.set(publishToken) + channels(publishChannels.split(",")) + token(publishToken) } runIdeForUiTests { @@ -128,9 +128,9 @@ tasks { } runPluginVerifier { - ideVersions.set(listOf("IC-2020.2.3", "IC-2020.3.2")) - downloadDir.set("${project.buildDir}/pluginVerifier/ides") - teamCityOutputFormat.set(true) + ideVersions(listOf("IC-2020.2.3", "IC-2020.3.2")) + downloadDirectory("${project.buildDir}/pluginVerifier/ides") + teamCityOutputFormat = true } } diff --git a/settings.gradle b/settings.gradle index 5c89b5c51c..bb770be052 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,13 +16,4 @@ * along with this program. If not, see . */ -pluginManagement { - repositories { - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - gradlePluginPortal() - } -} - rootProject.name = 'IdeaVIM' From 018e5cba83ffb0559550ad1a9c256dfb53a86bf2 Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Fri, 14 May 2021 09:41:55 +0300 Subject: [PATCH 32/34] Enable copy action only if there are things to copy --- .../maddyhome/idea/vim/ui/VimEmulationConfigurable.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java index dccc0ce778..00812ae3ef 100644 --- a/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java +++ b/src/com/maddyhome/idea/vim/ui/VimEmulationConfigurable.java @@ -378,6 +378,14 @@ public CopyForRcAction(VimShortcutConflictsTable.@NotNull Model model) { myModel = model; } + @Override + public void updateButton(@NotNull AnActionEvent e) { + boolean enabled = myModel.getRows().stream().anyMatch(it -> it.getOwner() instanceof ShortcutOwnerInfo.AllModes && + ((ShortcutOwnerInfo.AllModes)it.getOwner()).getOwner() != + ShortcutOwner.UNDEFINED); + e.getPresentation().setEnabled(enabled); + } + @Override public void actionPerformed(@NotNull AnActionEvent e) { StringBuilder stringBuilder = new StringBuilder(); From a9f1d2ac147cb2e8770371e91f42dc97ea931f6f Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Fri, 14 May 2021 09:49:40 +0300 Subject: [PATCH 33/34] Update changelog --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 43b34f79a5..af3a9f412a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -27,6 +27,7 @@ usual beta standards. ### Features: * Support `sethandler` command to configure shortcuts conflicts via `~/.ideavimrc` file. See [docs](https://jb.gg/vim-sethandler). * Support `vim-paragraph-motion` extension [VIM-2290](https://youtrack.jetbrains.com/issue/VIM-2290) | [vim-paragraph-motion](https://github.com/dbakker/vim-paragraph-motion) +* Add "Reset Handlers" button for "Conflicting Shortcuts" setting table ### Changes: * Rename "Vim Emulation" in settings to "Vim" From 8ca865e5aa3e1c5c8be0745b5ad5fa63bc066fbe Mon Sep 17 00:00:00 2001 From: Alex Plate Date: Fri, 14 May 2021 10:52:32 +0300 Subject: [PATCH 34/34] Remove redundant SAM constructors --- src/com/maddyhome/idea/vim/ex/CommandParser.kt | 2 +- .../maddyhome/idea/vim/ex/handler/ActionHandler.kt | 2 +- .../extension/highlightedyank/VimHighlightedYank.kt | 12 +++++------- .../idea/vim/extension/nerdtree/NerdTree.kt | 2 +- .../plugins/ideavim/group/SearchGroupTest.kt | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/com/maddyhome/idea/vim/ex/CommandParser.kt b/src/com/maddyhome/idea/vim/ex/CommandParser.kt index 1ff84f37f0..d2eba01316 100644 --- a/src/com/maddyhome/idea/vim/ex/CommandParser.kt +++ b/src/com/maddyhome/idea/vim/ex/CommandParser.kt @@ -63,7 +63,7 @@ object CommandParser { // IdeaVim doesn't support contribution to ex_command_ep extension point, so technically we can skip this update, // but let's support dynamic plugins in a more classic way and reload handlers on every EP change. EX_COMMAND_EP.addChangeListener( - Runnable { + { unregisterHandlers() registerHandlers() }, diff --git a/src/com/maddyhome/idea/vim/ex/handler/ActionHandler.kt b/src/com/maddyhome/idea/vim/ex/handler/ActionHandler.kt index 42e7fb747a..ffa0c0a99d 100644 --- a/src/com/maddyhome/idea/vim/ex/handler/ActionHandler.kt +++ b/src/com/maddyhome/idea/vim/ex/handler/ActionHandler.kt @@ -53,7 +53,7 @@ class ActionHandler : CommandHandler.SingleExecution() { if (application.isUnitTestMode) { executeAction(action, context) } else { - runAfterGotFocus(Runnable { executeAction(action, context) }) + runAfterGotFocus { executeAction(action, context) } } return true } diff --git a/src/com/maddyhome/idea/vim/extension/highlightedyank/VimHighlightedYank.kt b/src/com/maddyhome/idea/vim/extension/highlightedyank/VimHighlightedYank.kt index d1ae3540a4..749cd73ea3 100644 --- a/src/com/maddyhome/idea/vim/extension/highlightedyank/VimHighlightedYank.kt +++ b/src/com/maddyhome/idea/vim/extension/highlightedyank/VimHighlightedYank.kt @@ -20,7 +20,6 @@ package com.maddyhome.idea.vim.extension.highlightedyank import com.intellij.ide.ui.LafManager import com.intellij.ide.ui.LafManagerListener -import com.intellij.openapi.Disposable import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.colors.EditorColors @@ -120,12 +119,11 @@ class VimHighlightedYank : VimExtension, VimYankListener, VimInsertListener { val project = editor.project if (project != null) { Disposer.register( - VimProjectService.getInstance(project), - Disposable { - this.editor = null - yankHighlighters.clear() - } - ) + VimProjectService.getInstance(project) + ) { + this.editor = null + yankHighlighters.clear() + } } if (range.isMultiple) { diff --git a/src/com/maddyhome/idea/vim/extension/nerdtree/NerdTree.kt b/src/com/maddyhome/idea/vim/extension/nerdtree/NerdTree.kt index 42ae176ad8..20fa460de0 100644 --- a/src/com/maddyhome/idea/vim/extension/nerdtree/NerdTree.kt +++ b/src/com/maddyhome/idea/vim/extension/nerdtree/NerdTree.kt @@ -493,7 +493,7 @@ class NerdTree : VimExtension { if (application.isUnitTestMode) { KeyHandler.executeAction(action, context) } else { - runAfterGotFocus(Runnable { KeyHandler.executeAction(action, context) }) + runAfterGotFocus { KeyHandler.executeAction(action, context) } } } diff --git a/test/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt b/test/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt index a75486dacb..0fea622cdc 100644 --- a/test/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt +++ b/test/org/jetbrains/plugins/ideavim/group/SearchGroupTest.kt @@ -1427,7 +1427,7 @@ class SearchGroupTest : VimTestCase() { val ref = Ref.create(-1) RunnableHelper.runReadCommand( project, - Runnable { + { // Does not move the caret! val n = searchGroup.processSearchCommand(editor, pattern, myFixture.caretOffset, Direction.FORWARDS) ref.set(n) @@ -1451,7 +1451,7 @@ class SearchGroupTest : VimTestCase() { val ref = Ref.create(-1) RunnableHelper.runReadCommand( project, - Runnable { + { // Does not move the caret! val n = searchGroup.processSearchCommand(editor, pattern, myFixture.caretOffset, Direction.FORWARDS) ref.set(n)