mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2024-11-25 16:42:55 +01:00
Compare commits
No commits in common. "e42b4d0ea349348029e85af58dfe80a80470617d" and "86bf723791d538f7cd24c66f83fae57dca3026ea" have entirely different histories.
e42b4d0ea3
...
86bf723791
4
.teamcity/_Self/Constants.kt
vendored
4
.teamcity/_Self/Constants.kt
vendored
@ -5,8 +5,8 @@ object Constants {
|
|||||||
const val EAP_CHANNEL = "eap"
|
const val EAP_CHANNEL = "eap"
|
||||||
const val DEV_CHANNEL = "Dev"
|
const val DEV_CHANNEL = "Dev"
|
||||||
|
|
||||||
const val VERSION = "1.11.1"
|
const val VERSION = "1.10.3"
|
||||||
const val DEV_VERSION = "1.12.0"
|
const val DEV_VERSION = "1.11.0"
|
||||||
|
|
||||||
const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT"
|
const val GITHUB_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||||
const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT"
|
const val NVIM_TESTS = "LATEST-EAP-SNAPSHOT"
|
||||||
|
@ -23,7 +23,7 @@ It is important to distinguish EAP from traditional pre-release software.
|
|||||||
Please note that the quality of EAP versions may at times be way below even
|
Please note that the quality of EAP versions may at times be way below even
|
||||||
usual beta standards.
|
usual beta standards.
|
||||||
|
|
||||||
## 1.11.0, 2022-08-09
|
## To Be Released
|
||||||
|
|
||||||
### Features:
|
### Features:
|
||||||
* Add `gcu` command for Commentary plugin
|
* Add `gcu` command for Commentary plugin
|
||||||
@ -53,14 +53,12 @@ usual beta standards.
|
|||||||
* [VIM-2595](https://youtrack.jetbrains.com/issue/VIM-2595) Support plugins in macro execution
|
* [VIM-2595](https://youtrack.jetbrains.com/issue/VIM-2595) Support plugins in macro execution
|
||||||
* [VIM-2671](https://youtrack.jetbrains.com/issue/VIM-2671) Fix using plugins from mappings
|
* [VIM-2671](https://youtrack.jetbrains.com/issue/VIM-2671) Fix using plugins from mappings
|
||||||
* [VIM-2675](https://youtrack.jetbrains.com/issue/VIM-2675) Fix numbering register in visual mode
|
* [VIM-2675](https://youtrack.jetbrains.com/issue/VIM-2675) Fix numbering register in visual mode
|
||||||
|
* [VIM-696](https://youtrack.jetbrains.com/issue/VIM-696/vim-selection-issue-after-undo) Fix selection after undo
|
||||||
* [VIM-744](https://youtrack.jetbrains.com/issue/VIM-744/Use-undoredo-with-count-modifier) Add count to undo/redo
|
* [VIM-744](https://youtrack.jetbrains.com/issue/VIM-744/Use-undoredo-with-count-modifier) Add count to undo/redo
|
||||||
* [VIM-1862](https://youtrack.jetbrains.com/issue/VIM-1862/Ex-commands-executed-in-keymaps-and-macros-are-added-to-the-command-history) Fix command history
|
* [VIM-1862](https://youtrack.jetbrains.com/issue/VIM-1862/Ex-commands-executed-in-keymaps-and-macros-are-added-to-the-command-history) Fix command history
|
||||||
* [VIM-2227](https://youtrack.jetbrains.com/issue/VIM-2227) Wrong behavior when deleting / changing surround with invalid character
|
* [VIM-2227](https://youtrack.jetbrains.com/issue/VIM-2227) Wrong behavior when deleting / changing surround with invalid character
|
||||||
* [VIM-2691](https://youtrack.jetbrains.com/issue/VIM-2691) Save file on :w
|
* [VIM-2691](https://youtrack.jetbrains.com/issue/VIM-2691) Save file on :w
|
||||||
* [VIM-2710](https://youtrack.jetbrains.com/issue/VIM-2710) Show options value on `set opt`
|
* [VIM-2710](https://youtrack.jetbrains.com/issue/VIM-2710) Show options value on `set opt`
|
||||||
* [VIM-913](https://youtrack.jetbrains.com/issue/VIM-913) Partially fix the issue with macros and autocompletion
|
|
||||||
* [VIM-2723](https://youtrack.jetbrains.com/issue/VIM-2723) Move focus to editor after :q
|
|
||||||
* [VIM-2728](https://youtrack.jetbrains.com/issue/VIM-2728) Give access to global variables
|
|
||||||
|
|
||||||
### Merged PRs:
|
### Merged PRs:
|
||||||
* [468](https://github.com/JetBrains/ideavim/pull/468) by [Thomas Schouten](https://github.com/PHPirates): Implement UserDataHolder for EditorDataContext
|
* [468](https://github.com/JetBrains/ideavim/pull/468) by [Thomas Schouten](https://github.com/PHPirates): Implement UserDataHolder for EditorDataContext
|
||||||
@ -72,8 +70,6 @@ usual beta standards.
|
|||||||
* [519](https://github.com/JetBrains/ideavim/pull/519) by [chylex](https://github.com/chylex): Fix(VIM-2227): Wrong behavior when deleting / changing surround with invalid character
|
* [519](https://github.com/JetBrains/ideavim/pull/519) by [chylex](https://github.com/chylex): Fix(VIM-2227): Wrong behavior when deleting / changing surround with invalid character
|
||||||
* [525](https://github.com/JetBrains/ideavim/pull/525) by [Matt Ellis](https://github.com/citizenmatt): Improve handling of fractional width fonts
|
* [525](https://github.com/JetBrains/ideavim/pull/525) by [Matt Ellis](https://github.com/citizenmatt): Improve handling of fractional width fonts
|
||||||
* [526](https://github.com/JetBrains/ideavim/pull/526) by [Alex Pláte](https://github.com/AlexPl292): Create gradle.properties
|
* [526](https://github.com/JetBrains/ideavim/pull/526) by [Alex Pláte](https://github.com/AlexPl292): Create gradle.properties
|
||||||
* [528](https://github.com/JetBrains/ideavim/pull/528) by [chylex](https://github.com/chylex): Implement partial code completion support in macros
|
|
||||||
* [531](https://github.com/JetBrains/ideavim/pull/531) by [Matt Ellis](https://github.com/citizenmatt): Consolidate doTest methods
|
|
||||||
|
|
||||||
## 1.10.0, 2022-02-17
|
## 1.10.0, 2022-02-17
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ OK, ready to do some coding?
|
|||||||
Yoo hoo! You’re all set to begin contributing.
|
Yoo hoo! You’re all set to begin contributing.
|
||||||
We've prepared some useful configurations for you:
|
We've prepared some useful configurations for you:
|
||||||
|
|
||||||
![Prepared configurations light](assets/contributing/configs-light.png#gh-light-mode-only)![Prepared configurations dark](assets/contributing/configs-dark.png#gh-dark-mode-only)
|
![Prepared configurations](assets/contributing/configurations.png)
|
||||||
|
|
||||||
And here are useful gradle commands:
|
And here are useful gradle commands:
|
||||||
|
|
||||||
|
@ -226,10 +226,7 @@ Ex commands or via `:map` command mappings:
|
|||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><strong>"Track action Ids" Details</strong> (click to see)</summary>
|
<summary><strong>"Track action Ids" Details</strong> (click to see)</summary>
|
||||||
<picture>
|
<img src="assets/readme/track_action_id.gif" alt="track action ids"/>
|
||||||
<source media="(prefers-color-scheme: dark)" srcset="assets/readme/track_action_dark.gif">
|
|
||||||
<img src="assets/readme/track_action_light.gif" alt="track action ids"/>
|
|
||||||
</picture>
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 27 KiB |
Binary file not shown.
Before Width: | Height: | Size: 31 KiB |
BIN
assets/contributing/configurations.png
Normal file
BIN
assets/contributing/configurations.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.0 MiB |
BIN
assets/readme/track_action_id.gif
Normal file
BIN
assets/readme/track_action_id.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 MiB |
Binary file not shown.
Before Width: | Height: | Size: 981 KiB |
@ -15,9 +15,7 @@ buildscript {
|
|||||||
classpath("com.github.AlexPl292:mark-down-to-slack:1.1.2")
|
classpath("com.github.AlexPl292:mark-down-to-slack:1.1.2")
|
||||||
classpath("org.eclipse.jgit:org.eclipse.jgit:6.1.0.202203080745-r")
|
classpath("org.eclipse.jgit:org.eclipse.jgit:6.1.0.202203080745-r")
|
||||||
classpath("org.kohsuke:github-api:1.305")
|
classpath("org.kohsuke:github-api:1.305")
|
||||||
|
classpath("org.jetbrains:markdown:0.3.1")
|
||||||
// This comes from the changelog plugin
|
|
||||||
// classpath("org.jetbrains:markdown:0.3.1")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +24,7 @@ plugins {
|
|||||||
java
|
java
|
||||||
kotlin("jvm") version "1.6.21"
|
kotlin("jvm") version "1.6.21"
|
||||||
|
|
||||||
id("org.jetbrains.intellij") version "1.8.0"
|
id("org.jetbrains.intellij") version "1.7.0-SNAPSHOT"
|
||||||
id("org.jetbrains.changelog") version "1.3.1"
|
id("org.jetbrains.changelog") version "1.3.1"
|
||||||
|
|
||||||
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
|
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
|
||||||
@ -275,7 +273,7 @@ changelog {
|
|||||||
itemPrefix.set("*")
|
itemPrefix.set("*")
|
||||||
path.set("${project.projectDir}/CHANGES.md")
|
path.set("${project.projectDir}/CHANGES.md")
|
||||||
unreleasedTerm.set("To Be Released")
|
unreleasedTerm.set("To Be Released")
|
||||||
headerParserRegex.set("(\\d\\.\\d+(.\\d+)?)".toRegex())
|
headerParserRegex.set("\\d\\.\\d+(.\\d+)?".toRegex())
|
||||||
// header = { "${project.version}" }
|
// header = { "${project.version}" }
|
||||||
// version = "0.60"
|
// version = "0.60"
|
||||||
}
|
}
|
||||||
@ -328,8 +326,6 @@ tasks.register("slackNotification") {
|
|||||||
println("Response code: $postRc")
|
println("Response code: $postRc")
|
||||||
if (postRc == 200) {
|
if (postRc == 200) {
|
||||||
println(inputStream.bufferedReader().use { it.readText() })
|
println(inputStream.bufferedReader().use { it.readText() })
|
||||||
} else {
|
|
||||||
println(errorStream.bufferedReader().use { it.readText() })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,14 +18,8 @@
|
|||||||
|
|
||||||
package com.maddyhome.idea.vim
|
package com.maddyhome.idea.vim
|
||||||
|
|
||||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
|
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import com.intellij.openapi.project.ProjectManagerListener
|
|
||||||
import com.intellij.openapi.startup.StartupActivity
|
import com.intellij.openapi.startup.StartupActivity
|
||||||
import com.maddyhome.idea.vim.api.injector
|
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
|
||||||
import com.maddyhome.idea.vim.helper.localEditors
|
|
||||||
import com.maddyhome.idea.vim.options.OptionScope
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Alex Plate
|
* @author Alex Plate
|
||||||
@ -42,19 +36,3 @@ class PluginStartup : StartupActivity.DumbAware/*, LightEditCompatible*/ {
|
|||||||
VimPlugin.getInstance().initialize()
|
VimPlugin.getInstance().initialize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a temporal workaround for VIM-2487
|
|
||||||
class PyNotebooksCloseWorkaround : ProjectManagerListener {
|
|
||||||
override fun projectClosingBeforeSave(project: Project) {
|
|
||||||
val close = injector.optionService.getOptionValue(OptionScope.GLOBAL, "closenotebooks").asBoolean()
|
|
||||||
if (close) {
|
|
||||||
localEditors().forEach { editor ->
|
|
||||||
val virtualFile = EditorHelper.getVirtualFile(editor)
|
|
||||||
if (virtualFile?.extension == "ipynb") {
|
|
||||||
val fileEditorManager = FileEditorManagerEx.getInstanceEx(project)
|
|
||||||
fileEditorManager.closeFile(virtualFile)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
package com.maddyhome.idea.vim.action
|
package com.maddyhome.idea.vim.action
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.ActionPlaces
|
import com.intellij.openapi.actionSystem.ActionPlaces
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.project.DumbAwareToggleAction
|
import com.intellij.openapi.project.DumbAwareToggleAction
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
@ -43,6 +42,4 @@ class VimPluginToggleAction : DumbAwareToggleAction()/*, LightEditCompatible*/ {
|
|||||||
if (VimPlugin.isEnabled()) MessageHelper.message("action.VimPluginToggle.enabled") else MessageHelper.message("action.VimPluginToggle.enable")
|
if (VimPlugin.isEnabled()) MessageHelper.message("action.VimPluginToggle.enabled") else MessageHelper.message("action.VimPluginToggle.enable")
|
||||||
} else MessageHelper.message("action.VimPluginToggle.text")
|
} else MessageHelper.message("action.VimPluginToggle.text")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ package com.maddyhome.idea.vim.action
|
|||||||
import com.google.common.collect.ImmutableSet
|
import com.google.common.collect.ImmutableSet
|
||||||
import com.intellij.codeInsight.lookup.LookupManager
|
import com.intellij.codeInsight.lookup.LookupManager
|
||||||
import com.intellij.openapi.actionSystem.ActionManager
|
import com.intellij.openapi.actionSystem.ActionManager
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnAction
|
import com.intellij.openapi.actionSystem.AnAction
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.EmptyAction
|
import com.intellij.openapi.actionSystem.EmptyAction
|
||||||
@ -96,10 +95,6 @@ class VimShortcutKeyAction : AnAction(), DumbAware/*, LightEditCompatible*/ {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// There is a chance that we can use BGT, but we call for isCell inside the update.
|
|
||||||
// Not sure if can can use BGT with this call. Let's use EDT for now.
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.EDT
|
|
||||||
|
|
||||||
override fun update(e: AnActionEvent) {
|
override fun update(e: AnActionEvent) {
|
||||||
val start = if (traceTime) System.currentTimeMillis() else null
|
val start = if (traceTime) System.currentTimeMillis() else null
|
||||||
e.presentation.isEnabled = isEnabled(e)
|
e.presentation.isEnabled = isEnabled(e)
|
||||||
|
@ -21,7 +21,6 @@ package com.maddyhome.idea.vim.extension.nerdtree
|
|||||||
import com.intellij.ide.projectView.ProjectView
|
import com.intellij.ide.projectView.ProjectView
|
||||||
import com.intellij.ide.projectView.impl.ProjectViewImpl
|
import com.intellij.ide.projectView.impl.ProjectViewImpl
|
||||||
import com.intellij.openapi.actionSystem.ActionManager
|
import com.intellij.openapi.actionSystem.ActionManager
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.CommonDataKeys
|
import com.intellij.openapi.actionSystem.CommonDataKeys
|
||||||
import com.intellij.openapi.application.ApplicationManager
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
@ -173,7 +172,7 @@ class NerdTree : VimExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ProjectViewListener(private val project: Project) : ToolWindowManagerListener {
|
class ProjectViewListener(private val project: Project) : ToolWindowManagerListener {
|
||||||
override fun toolWindowShown(toolWindow: ToolWindow) {
|
override fun toolWindowShown(id: String, toolWindow: ToolWindow) {
|
||||||
if (ToolWindowId.PROJECT_VIEW != toolWindow.id) return
|
if (ToolWindowId.PROJECT_VIEW != toolWindow.id) return
|
||||||
|
|
||||||
val dispatcher = NerdDispatcher.getInstance(project)
|
val dispatcher = NerdDispatcher.getInstance(project)
|
||||||
@ -243,8 +242,6 @@ class NerdTree : VimExtension {
|
|||||||
e.presentation.isEnabled = !speedSearchIsHere(project)
|
e.presentation.isEnabled = !speedSearchIsHere(project)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
|
|
||||||
private fun speedSearchIsHere(project: Project): Boolean {
|
private fun speedSearchIsHere(project: Project): Boolean {
|
||||||
val component = ProjectView.getInstance(project).currentProjectViewPane.tree ?: return false
|
val component = ProjectView.getInstance(project).currentProjectViewPane.tree ?: return false
|
||||||
return SpeedSearchSupply.getSupply(component) != null
|
return SpeedSearchSupply.getSupply(component) != null
|
||||||
@ -563,3 +560,7 @@ class NerdTree : VimExtension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun <T> Node<T>.addLeafs(keys: String, actionHolder: T) {
|
||||||
|
addLeafs(injector.parser.parseKeys(keys), actionHolder)
|
||||||
|
}
|
||||||
|
@ -20,7 +20,6 @@ package com.maddyhome.idea.vim.group;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.editor.Document;
|
import com.intellij.openapi.editor.Document;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
@ -28,7 +27,6 @@ import com.intellij.openapi.editor.LogicalPosition;
|
|||||||
import com.intellij.openapi.fileEditor.*;
|
import com.intellij.openapi.fileEditor.*;
|
||||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||||
import com.intellij.openapi.fileEditor.impl.EditorWindow;
|
import com.intellij.openapi.fileEditor.impl.EditorWindow;
|
||||||
import com.intellij.openapi.fileEditor.impl.EditorsSplitters;
|
|
||||||
import com.intellij.openapi.fileTypes.FileType;
|
import com.intellij.openapi.fileTypes.FileType;
|
||||||
import com.intellij.openapi.fileTypes.FileTypeManager;
|
import com.intellij.openapi.fileTypes.FileTypeManager;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
@ -161,10 +159,6 @@ public class FileGroup extends VimFileBase {
|
|||||||
if (virtualFile != null && window != null) {
|
if (virtualFile != null && window != null) {
|
||||||
window.closeFile(virtualFile);
|
window.closeFile(virtualFile);
|
||||||
}
|
}
|
||||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
|
||||||
// This thing doesn't have an implementation in test mode
|
|
||||||
EditorsSplitters.focusDefaultComponentInSplittersIfPresent(project);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,10 +175,6 @@ public class FileGroup extends VimFileBase {
|
|||||||
if (number >= 0 && number < editors.length) {
|
if (number >= 0 && number < editors.length) {
|
||||||
fileEditorManager.closeFile(editors[number], window);
|
fileEditorManager.closeFile(editors[number], window);
|
||||||
}
|
}
|
||||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
|
||||||
// This thing doesn't have an implementation in test mode
|
|
||||||
EditorsSplitters.focusDefaultComponentInSplittersIfPresent(project);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,6 @@ import com.intellij.notification.Notification
|
|||||||
import com.intellij.notification.NotificationGroup
|
import com.intellij.notification.NotificationGroup
|
||||||
import com.intellij.notification.NotificationGroupManager
|
import com.intellij.notification.NotificationGroupManager
|
||||||
import com.intellij.notification.NotificationType
|
import com.intellij.notification.NotificationType
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnAction
|
import com.intellij.openapi.actionSystem.AnAction
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.KeyboardShortcut
|
import com.intellij.openapi.actionSystem.KeyboardShortcut
|
||||||
@ -222,8 +221,6 @@ class NotificationService(private val project: Project?) {
|
|||||||
override fun update(e: AnActionEvent) {
|
override fun update(e: AnActionEvent) {
|
||||||
e.presentation.isEnabled = id != null
|
e.presentation.isEnabled = id != null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class StopTracking : DumbAwareAction("Stop Tracking") {
|
class StopTracking : DumbAwareAction("Stop Tracking") {
|
||||||
@ -260,8 +257,6 @@ class NotificationService(private val project: Project?) {
|
|||||||
val actionText = if (VimRcService.findIdeaVimRc() != null) "Open ~/.ideavimrc" else "Create ~/.ideavimrc"
|
val actionText = if (VimRcService.findIdeaVimRc() != null) "Open ~/.ideavimrc" else "Create ~/.ideavimrc"
|
||||||
e.presentation.text = actionText
|
e.presentation.text = actionText
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("DialogTitleCapitalization")
|
@Suppress("DialogTitleCapitalization")
|
||||||
|
@ -56,6 +56,7 @@ class UndoRedoHelper : UndoRedoBase() {
|
|||||||
SelectionVimListenerSuppressor.lock().use { undoManager.undo(fileEditor) }
|
SelectionVimListenerSuppressor.lock().use { undoManager.undo(fileEditor) }
|
||||||
} else {
|
} else {
|
||||||
performUntilFileChanges(editor, { undoManager.isUndoAvailable(fileEditor) }, { undoManager.undo(fileEditor) })
|
performUntilFileChanges(editor, { undoManager.isUndoAvailable(fileEditor) }, { undoManager.undo(fileEditor) })
|
||||||
|
}
|
||||||
|
|
||||||
editor?.carets()?.forEach {
|
editor?.carets()?.forEach {
|
||||||
val ijCaret = it.ij
|
val ijCaret = it.ij
|
||||||
@ -68,8 +69,6 @@ class UndoRedoHelper : UndoRedoBase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -86,10 +85,10 @@ class UndoRedoHelper : UndoRedoBase() {
|
|||||||
SelectionVimListenerSuppressor.lock().use { undoManager.redo(fileEditor) }
|
SelectionVimListenerSuppressor.lock().use { undoManager.redo(fileEditor) }
|
||||||
} else {
|
} else {
|
||||||
performUntilFileChanges(editor, { undoManager.isRedoAvailable(fileEditor) }, { undoManager.redo(fileEditor) })
|
performUntilFileChanges(editor, { undoManager.isRedoAvailable(fileEditor) }, { undoManager.redo(fileEditor) })
|
||||||
|
}
|
||||||
CommandProcessor.getInstance().runUndoTransparentAction {
|
CommandProcessor.getInstance().runUndoTransparentAction {
|
||||||
editor?.carets()?.forEach { it.ij.removeSelection() }
|
editor?.carets()?.forEach { it.ij.removeSelection() }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -19,10 +19,8 @@
|
|||||||
package com.maddyhome.idea.vim.listener
|
package com.maddyhome.idea.vim.listener
|
||||||
|
|
||||||
import com.intellij.codeInsight.lookup.Lookup
|
import com.intellij.codeInsight.lookup.Lookup
|
||||||
import com.intellij.codeInsight.lookup.LookupManager
|
|
||||||
import com.intellij.codeInsight.lookup.LookupManagerListener
|
import com.intellij.codeInsight.lookup.LookupManagerListener
|
||||||
import com.intellij.codeInsight.lookup.impl.LookupImpl
|
import com.intellij.codeInsight.lookup.impl.LookupImpl
|
||||||
import com.intellij.codeInsight.lookup.impl.actions.ChooseItemAction
|
|
||||||
import com.intellij.codeInsight.template.Template
|
import com.intellij.codeInsight.template.Template
|
||||||
import com.intellij.codeInsight.template.TemplateEditingAdapter
|
import com.intellij.codeInsight.template.TemplateEditingAdapter
|
||||||
import com.intellij.codeInsight.template.TemplateManagerListener
|
import com.intellij.codeInsight.template.TemplateManagerListener
|
||||||
@ -37,10 +35,10 @@ import com.intellij.openapi.actionSystem.ex.AnActionListener
|
|||||||
import com.intellij.openapi.actionSystem.impl.ProxyShortcutSet
|
import com.intellij.openapi.actionSystem.impl.ProxyShortcutSet
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.editor.Editor
|
||||||
import com.intellij.openapi.project.DumbAwareToggleAction
|
import com.intellij.openapi.project.DumbAwareToggleAction
|
||||||
import com.intellij.openapi.util.TextRange
|
|
||||||
import com.maddyhome.idea.vim.KeyHandler
|
import com.maddyhome.idea.vim.KeyHandler
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import com.maddyhome.idea.vim.group.NotificationService
|
||||||
import com.maddyhome.idea.vim.helper.EditorDataContext
|
import com.maddyhome.idea.vim.helper.EditorDataContext
|
||||||
import com.maddyhome.idea.vim.helper.inNormalMode
|
import com.maddyhome.idea.vim.helper.inNormalMode
|
||||||
import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere
|
import com.maddyhome.idea.vim.helper.isIdeaVimDisabledHere
|
||||||
@ -51,8 +49,6 @@ import com.maddyhome.idea.vim.options.OptionScope
|
|||||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt
|
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimInt
|
||||||
import com.maddyhome.idea.vim.vimscript.model.options.helpers.IdeaRefactorModeHelper
|
import com.maddyhome.idea.vim.vimscript.model.options.helpers.IdeaRefactorModeHelper
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import java.awt.event.KeyEvent
|
|
||||||
import javax.swing.KeyStroke
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Alex Plate
|
* @author Alex Plate
|
||||||
@ -64,8 +60,6 @@ object IdeaSpecifics {
|
|||||||
private val surrounderAction =
|
private val surrounderAction =
|
||||||
"com.intellij.codeInsight.generation.surroundWith.SurroundWithHandler\$InvokeSurrounderAction"
|
"com.intellij.codeInsight.generation.surroundWith.SurroundWithHandler\$InvokeSurrounderAction"
|
||||||
private var editor: Editor? = null
|
private var editor: Editor? = null
|
||||||
private var completionPrevDocumentLength: Int? = null
|
|
||||||
private var completionPrevDocumentOffset: Int? = null
|
|
||||||
override fun beforeActionPerformed(action: AnAction, event: AnActionEvent) {
|
override fun beforeActionPerformed(action: AnAction, event: AnActionEvent) {
|
||||||
if (!VimPlugin.isEnabled()) return
|
if (!VimPlugin.isEnabled()) return
|
||||||
|
|
||||||
@ -74,52 +68,19 @@ object IdeaSpecifics {
|
|||||||
editor = hostEditor
|
editor = hostEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//region Track action id
|
||||||
if (VimPlugin.getOptionService().isSet(OptionScope.GLOBAL, OptionConstants.trackactionidsName)) {
|
if (VimPlugin.getOptionService().isSet(OptionScope.GLOBAL, OptionConstants.trackactionidsName)) {
|
||||||
|
if (action !is NotificationService.ActionIdNotifier.CopyActionId && action !is NotificationService.ActionIdNotifier.StopTracking) {
|
||||||
val id: String? = ActionManager.getInstance().getId(action) ?: (action.shortcutSet as? ProxyShortcutSet)?.actionId
|
val id: String? = ActionManager.getInstance().getId(action) ?: (action.shortcutSet as? ProxyShortcutSet)?.actionId
|
||||||
VimPlugin.getNotifications(event.dataContext.getData(CommonDataKeys.PROJECT)).notifyActionId(id)
|
VimPlugin.getNotifications(event.dataContext.getData(CommonDataKeys.PROJECT)).notifyActionId(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hostEditor != null && action is ChooseItemAction && hostEditor.vimStateMachine?.isRecording == true) {
|
|
||||||
val lookup = LookupManager.getActiveLookup(hostEditor)
|
|
||||||
if (lookup != null) {
|
|
||||||
val charsToRemove = hostEditor.caretModel.primaryCaret.offset - lookup.lookupStart
|
|
||||||
|
|
||||||
val register = VimPlugin.getRegister()
|
|
||||||
val backSpace = KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)
|
|
||||||
repeat(charsToRemove) {
|
|
||||||
register.recordKeyStroke(backSpace)
|
|
||||||
}
|
|
||||||
|
|
||||||
completionPrevDocumentLength = hostEditor.document.textLength - charsToRemove
|
|
||||||
completionPrevDocumentOffset = lookup.lookupStart
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
//endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun afterActionPerformed(action: AnAction, event: AnActionEvent, result: AnActionResult) {
|
override fun afterActionPerformed(action: AnAction, event: AnActionEvent, result: AnActionResult) {
|
||||||
if (!VimPlugin.isEnabled()) return
|
if (!VimPlugin.isEnabled()) return
|
||||||
|
|
||||||
val editor = editor
|
|
||||||
if (editor != null && action is ChooseItemAction && editor.vimStateMachine?.isRecording == true) {
|
|
||||||
val prevDocumentLength = completionPrevDocumentLength
|
|
||||||
val prevDocumentOffset = completionPrevDocumentOffset
|
|
||||||
|
|
||||||
if (prevDocumentLength != null && prevDocumentOffset != null) {
|
|
||||||
val register = VimPlugin.getRegister()
|
|
||||||
val addedTextLength = editor.document.textLength - prevDocumentLength
|
|
||||||
val caretShift = addedTextLength - (editor.caretModel.primaryCaret.offset - prevDocumentOffset)
|
|
||||||
val leftArrow = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0)
|
|
||||||
|
|
||||||
register.recordText(editor.document.getText(TextRange(prevDocumentOffset, prevDocumentOffset + addedTextLength)))
|
|
||||||
repeat(caretShift.coerceAtLeast(0)) {
|
|
||||||
register.recordKeyStroke(leftArrow)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.completionPrevDocumentLength = null
|
|
||||||
this.completionPrevDocumentOffset = null
|
|
||||||
}
|
|
||||||
|
|
||||||
//region Enter insert mode after surround with if
|
//region Enter insert mode after surround with if
|
||||||
if (surrounderAction == action.javaClass.name && surrounderItems.any {
|
if (surrounderAction == action.javaClass.name && surrounderItems.any {
|
||||||
action.templatePresentation.text.endsWith(
|
action.templatePresentation.text.endsWith(
|
||||||
@ -138,7 +99,7 @@ object IdeaSpecifics {
|
|||||||
}
|
}
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
this.editor = null
|
editor = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ package com.maddyhome.idea.vim.ui
|
|||||||
|
|
||||||
import com.intellij.icons.AllIcons
|
import com.intellij.icons.AllIcons
|
||||||
import com.intellij.openapi.Disposable
|
import com.intellij.openapi.Disposable
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
||||||
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
||||||
@ -145,8 +144,6 @@ class ReloadVimRc : DumbAwareAction() {
|
|||||||
e.presentation.isEnabledAndVisible = true
|
e.presentation.isEnabledAndVisible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
|
|
||||||
override fun actionPerformed(e: AnActionEvent) {
|
override fun actionPerformed(e: AnActionEvent) {
|
||||||
val editor = e.getData(PlatformDataKeys.EDITOR) ?: return
|
val editor = e.getData(PlatformDataKeys.EDITOR) ?: return
|
||||||
FileDocumentManager.getInstance().saveDocumentAsIs(editor.document)
|
FileDocumentManager.getInstance().saveDocumentAsIs(editor.document)
|
||||||
|
@ -23,7 +23,6 @@ import com.intellij.ide.BrowserUtil
|
|||||||
import com.intellij.ide.DataManager
|
import com.intellij.ide.DataManager
|
||||||
import com.intellij.openapi.actionSystem.ActionManager
|
import com.intellij.openapi.actionSystem.ActionManager
|
||||||
import com.intellij.openapi.actionSystem.ActionPlaces
|
import com.intellij.openapi.actionSystem.ActionPlaces
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.DataContext
|
import com.intellij.openapi.actionSystem.DataContext
|
||||||
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
||||||
@ -159,8 +158,6 @@ class VimActions : DumbAwareAction() {
|
|||||||
val project = e.project
|
val project = e.project
|
||||||
e.presentation.isEnabledAndVisible = project != null && !project.isDisposed
|
e.presentation.isEnabledAndVisible = project != null && !project.isDisposed
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private object VimActionsPopup {
|
private object VimActionsPopup {
|
||||||
@ -267,6 +264,4 @@ internal object JoinEap : DumbAwareAction()/*, LightEditCompatible*/ {
|
|||||||
e.presentation.text = MessageHelper.message("action.subscribe.to.eap.text")
|
e.presentation.text = MessageHelper.message("action.subscribe.to.eap.text")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package com.maddyhome.idea.vim.ui.ex
|
package com.maddyhome.idea.vim.ui.ex
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||||
import com.intellij.openapi.actionSystem.KeyboardShortcut
|
import com.intellij.openapi.actionSystem.KeyboardShortcut
|
||||||
import com.intellij.openapi.project.DumbAwareAction
|
import com.intellij.openapi.project.DumbAwareAction
|
||||||
@ -70,7 +69,4 @@ class ExShortcutKeyAction(private val exEntryPanel: ExEntryPanel) : DumbAwareAct
|
|||||||
|
|
||||||
registerCustomShortcutSet({ shortcuts }, exEntryPanel)
|
registerCustomShortcutSet({ shortcuts }, exEntryPanel)
|
||||||
}
|
}
|
||||||
|
|
||||||
// / Or EDT? We access ExEntryPanel actually. But seems to work with BGT
|
|
||||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
|
||||||
}
|
}
|
||||||
|
@ -2,110 +2,7 @@
|
|||||||
<name>IdeaVim</name>
|
<name>IdeaVim</name>
|
||||||
<id>IdeaVIM</id>
|
<id>IdeaVIM</id>
|
||||||
<change-notes><![CDATA[
|
<change-notes><![CDATA[
|
||||||
<h3>Features:</h3>
|
<a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">Changes</a>
|
||||||
<ul>
|
|
||||||
<li>Add <code>gcu</code> command for Commentary plugin</li>
|
|
||||||
<li>Add <code>:Commentary</code> command, which works great for commands such as <code>:%g/fun/Commentary</code></li>
|
|
||||||
<li>Support <code>gc</code> – commentary text objects. E.g. <code>dgc</code>: delete commented text.</li>
|
|
||||||
<li>Support <code>redo-register feature</code> | <a
|
|
||||||
href="https://youtrack.jetbrains.com/issue/VIM-2643/Dot-operator-doesn-t-increment-number-register-after-pasting-fro">VIM-2643</a>
|
|
||||||
| <a href="http://vimdoc.sourceforge.net/htmldoc/undo.html#redo-register">viminfo</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>Changes:</h3>
|
|
||||||
<ul>
|
|
||||||
<li>Uses the same mappings as Commentary, so custom bindings for the Vim plugin will work with IdeaVim, too.
|
|
||||||
E.g. <code><Plug>Commentary</code> instead of <code><Plug>(CommentMotion)</code>. Old mappings are
|
|
||||||
maintained for compatibility.
|
|
||||||
</li>
|
|
||||||
<li>If you open <code>~/.ideavimrc</code> in IDE, remove a mapping, and reload the config using the reload button,
|
|
||||||
the mapping will actually be unmapped.
|
|
||||||
</li>
|
|
||||||
<li>New vim (and IdeaVim) behaviour: <code>ci(</code>& friends searches for the brackets in the line.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>Fixes:</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2587">VIM-2587</a> Use ctrl-6 as ctrl-^</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2590">VIM-2590</a> Fix caret shape in PyCharm</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2553">VIM-2553</a> Substitute consecutive matches</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-1687">VIM-1687</a> Support count for <code>gcc</code></li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2381">VIM-2381</a> Fall back to line comment if block comment is
|
|
||||||
not available
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2589">VIM-2589</a> Add <code>gc</code> text object</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2604">VIM-2604</a> Update action execution rules</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2654">VIM-2654</a> Add support for <code>return</code> without
|
|
||||||
expression
|
|
||||||
</li>
|
|
||||||
<li><a
|
|
||||||
href="https://youtrack.jetbrains.com/issue/VIM-2630/Please-fix-warning-Shall-not-be-called-on-a-template-presentatio">VIM-2630</a>
|
|
||||||
Fix IDE freeze
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2661/Spamming-does-not-work">VIM-2661</a> Fix repeating the
|
|
||||||
<code>@@</code> command
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2668/tabm-or-tabm-with-no-number-does-not-match-vim-behavior">VIM-2668</a>
|
|
||||||
Fix omitted numbers in <code>tabm</code> command
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2595">VIM-2595</a> Support plugins in macro execution</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2671">VIM-2671</a> Fix using plugins from mappings</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2675">VIM-2675</a> Fix numbering register in visual mode</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-744/Use-undoredo-with-count-modifier">VIM-744</a> Add count to
|
|
||||||
undo/redo
|
|
||||||
</li>
|
|
||||||
<li><a
|
|
||||||
href="https://youtrack.jetbrains.com/issue/VIM-1862/Ex-commands-executed-in-keymaps-and-macros-are-added-to-the-command-history">VIM-1862</a>
|
|
||||||
Fix command history
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2227">VIM-2227</a> Wrong behavior when deleting / changing
|
|
||||||
surround with invalid character
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2691">VIM-2691</a> Save file on :w</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2710">VIM-2710</a> Show options value on <code>set opt</code>
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-913">VIM-913</a> Partially fix the issue with macros and
|
|
||||||
autocompletion
|
|
||||||
</li>
|
|
||||||
<li><a href="https://youtrack.jetbrains.com/issue/VIM-2723">VIM-2723</a> Move focus to editor after :q</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>Merged PRs:</h3>
|
|
||||||
<ul>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/468">468</a> by <a href="https://github.com/PHPirates">Thomas
|
|
||||||
Schouten</a>: Implement UserDataHolder for EditorDataContext
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/483">483</a> by <a href="https://github.com/Vvalter">Simon
|
|
||||||
Rainer</a>: Fix(VIM-2553): Substitute consecutive matches
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/488">488</a> by <a href="https://github.com/myzeiri">Martin
|
|
||||||
Yzeiri</a>: Add Matchit support for the C family of languages
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/493">493</a> by <a href="https://github.com/citizenmatt">Matt
|
|
||||||
Ellis</a>: Improvements to Commentary extension
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/494">494</a> by <a href="https://github.com/citizenmatt">Matt
|
|
||||||
Ellis</a>: Cleanup pre-212 CaretVisualAttributes compatibility code
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/504">504</a> by <a href="https://github.com/citizenmatt">Matt
|
|
||||||
Ellis</a>: Minor bug fixes
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/519">519</a> by <a href="https://github.com/chylex">chylex</a>:
|
|
||||||
Fix(VIM-2227): Wrong behavior when deleting / changing surround with invalid character
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/525">525</a> by <a href="https://github.com/citizenmatt">Matt
|
|
||||||
Ellis</a>: Improve handling of fractional width fonts
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/526">526</a> by <a href="https://github.com/AlexPl292">Alex
|
|
||||||
Pláte</a>: Create gradle.properties
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/528">528</a> by <a href="https://github.com/chylex">chylex</a>:
|
|
||||||
Implement partial code completion support in macros
|
|
||||||
</li>
|
|
||||||
<li><a href="https://github.com/JetBrains/ideavim/pull/531">531</a> by <a href="https://github.com/citizenmatt">Matt
|
|
||||||
Ellis</a>: Consolidate doTest methods
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
]]>
|
]]>
|
||||||
</change-notes>
|
</change-notes>
|
||||||
<description><![CDATA[
|
<description><![CDATA[
|
||||||
@ -139,11 +36,6 @@
|
|||||||
<depends optional="true" config-file="ides/ideavim-withAppCode.xml">com.intellij.modules.appcode</depends>
|
<depends optional="true" config-file="ides/ideavim-withAppCode.xml">com.intellij.modules.appcode</depends>
|
||||||
<depends optional="true" config-file="ideavim-withAceJump.xml">AceJump</depends>
|
<depends optional="true" config-file="ideavim-withAceJump.xml">AceJump</depends>
|
||||||
|
|
||||||
<applicationListeners>
|
|
||||||
<listener class="com.maddyhome.idea.vim.PyNotebooksCloseWorkaround"
|
|
||||||
topic="com.intellij.openapi.project.ProjectManagerListener"/>
|
|
||||||
</applicationListeners>
|
|
||||||
|
|
||||||
<application-components>
|
<application-components>
|
||||||
<component>
|
<component>
|
||||||
<implementation-class>com.maddyhome.idea.vim.DynamicLoaderStopper</implementation-class>
|
<implementation-class>com.maddyhome.idea.vim.DynamicLoaderStopper</implementation-class>
|
||||||
|
@ -53,8 +53,6 @@ internal object NeovimTesting {
|
|||||||
private lateinit var escapeCommand: String
|
private lateinit var escapeCommand: String
|
||||||
private lateinit var ctrlcCommand: String
|
private lateinit var ctrlcCommand: String
|
||||||
|
|
||||||
private var singleCaret = true
|
|
||||||
|
|
||||||
fun setUp(test: VimTestCase) {
|
fun setUp(test: VimTestCase) {
|
||||||
if (!neovimEnabled(test)) return
|
if (!neovimEnabled(test)) return
|
||||||
val nvimPath = System.getenv("ideavim.nvim.path") ?: "nvim"
|
val nvimPath = System.getenv("ideavim.nvim.path") ?: "nvim"
|
||||||
@ -92,35 +90,25 @@ internal object NeovimTesting {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun neovimEnabled(test: VimTestCase, editor: Editor? = null): Boolean {
|
private fun neovimEnabled(test: VimTestCase): Boolean {
|
||||||
val method = test.javaClass.getMethod(test.name)
|
val method = test.javaClass.getMethod(test.name)
|
||||||
val noBehaviourDiffers = !method.isAnnotationPresent(VimBehaviorDiffers::class.java)
|
val noBehaviourDiffers = !method.isAnnotationPresent(VimBehaviorDiffers::class.java)
|
||||||
val noTestingWithoutNeovim = !method.isAnnotationPresent(TestWithoutNeovim::class.java)
|
val noTestingWithoutNeovim = !method.isAnnotationPresent(TestWithoutNeovim::class.java)
|
||||||
val neovimTestingEnabled = System.getProperty("ideavim.nvim.test", "false")!!.toBoolean()
|
val neovimTestingEnabled = System.getProperty("ideavim.nvim.test", "false")!!.toBoolean()
|
||||||
val notParserTest = "org.jetbrains.plugins.ideavim.ex.parser" !in test.javaClass.packageName
|
val notParserTest = "org.jetbrains.plugins.ideavim.ex.parser" !in test.javaClass.packageName
|
||||||
val notScriptImplementation = "org.jetbrains.plugins.ideavim.ex.implementation" !in test.javaClass.packageName
|
val notScriptImplementation = "org.jetbrains.plugins.ideavim.ex.implementation" !in test.javaClass.packageName
|
||||||
val notExtension = "org.jetbrains.plugins.ideavim.extension" !in test.javaClass.packageName
|
return noBehaviourDiffers && noTestingWithoutNeovim && neovimTestingEnabled && notParserTest && notScriptImplementation
|
||||||
if (singleCaret) {
|
|
||||||
singleCaret = editor == null || editor.caretModel.caretCount == 1
|
|
||||||
}
|
|
||||||
return noBehaviourDiffers &&
|
|
||||||
noTestingWithoutNeovim &&
|
|
||||||
neovimTestingEnabled &&
|
|
||||||
notParserTest &&
|
|
||||||
notScriptImplementation &&
|
|
||||||
notExtension &&
|
|
||||||
singleCaret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setupEditor(editor: Editor, test: VimTestCase) {
|
fun setupEditor(editor: Editor, test: VimTestCase) {
|
||||||
if (!neovimEnabled(test, editor)) return
|
if (!neovimEnabled(test)) return
|
||||||
neovimApi.currentBuffer.get().setLines(0, -1, false, editor.document.text.split("\n")).get()
|
neovimApi.currentBuffer.get().setLines(0, -1, false, editor.document.text.split("\n")).get()
|
||||||
val charPosition = CharacterPosition.fromOffset(editor, editor.caretModel.offset)
|
val charPosition = CharacterPosition.fromOffset(editor, editor.caretModel.offset)
|
||||||
neovimApi.currentWindow.get().setCursor(VimCoords(charPosition.line + 1, charPosition.column)).get()
|
neovimApi.currentWindow.get().setCursor(VimCoords(charPosition.line + 1, charPosition.column)).get()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun typeCommand(keys: String, test: VimTestCase, editor: Editor) {
|
fun typeCommand(keys: String, test: VimTestCase) {
|
||||||
if (!neovimEnabled(test, editor)) return
|
if (!neovimEnabled(test)) return
|
||||||
when {
|
when {
|
||||||
keys.equals("<esc>", ignoreCase = true) -> neovimApi.input(escapeCommand).get()
|
keys.equals("<esc>", ignoreCase = true) -> neovimApi.input(escapeCommand).get()
|
||||||
keys.equals("<C-C>", ignoreCase = true) -> neovimApi.input(ctrlcCommand).get()
|
keys.equals("<C-C>", ignoreCase = true) -> neovimApi.input(ctrlcCommand).get()
|
||||||
@ -132,7 +120,7 @@ internal object NeovimTesting {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun assertState(editor: Editor, test: VimTestCase) {
|
fun assertState(editor: Editor, test: VimTestCase) {
|
||||||
if (!neovimEnabled(test, editor)) return
|
if (!neovimEnabled(test)) return
|
||||||
if (currentTestName != "") {
|
if (currentTestName != "") {
|
||||||
currentTestName = ""
|
currentTestName = ""
|
||||||
neovimTestsCounter++
|
neovimTestsCounter++
|
||||||
@ -152,7 +140,7 @@ internal object NeovimTesting {
|
|||||||
private fun getText(): String = neovimApi.currentBuffer.get().getLines(0, -1, false).get().joinToString("\n")
|
private fun getText(): String = neovimApi.currentBuffer.get().getLines(0, -1, false).get().joinToString("\n")
|
||||||
|
|
||||||
fun assertCaret(editor: Editor, test: VimTestCase) {
|
fun assertCaret(editor: Editor, test: VimTestCase) {
|
||||||
if (!neovimEnabled(test, editor)) return
|
if (!neovimEnabled(test)) return
|
||||||
if (currentTestName != "") {
|
if (currentTestName != "") {
|
||||||
currentTestName = ""
|
currentTestName = ""
|
||||||
neovimTestsCounter++
|
neovimTestsCounter++
|
||||||
@ -212,6 +200,7 @@ annotation class TestWithoutNeovim(val reason: SkipNeovimReason, val description
|
|||||||
|
|
||||||
enum class SkipNeovimReason {
|
enum class SkipNeovimReason {
|
||||||
PLUGIN,
|
PLUGIN,
|
||||||
|
MULTICARET,
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
INLAYS,
|
INLAYS,
|
||||||
@ -232,6 +221,7 @@ enum class SkipNeovimReason {
|
|||||||
EDITOR_MODIFICATION,
|
EDITOR_MODIFICATION,
|
||||||
|
|
||||||
CMD,
|
CMD,
|
||||||
|
IDEAVIMRC,
|
||||||
ACTION_COMMAND,
|
ACTION_COMMAND,
|
||||||
PLUG,
|
PLUG,
|
||||||
FOLDING,
|
FOLDING,
|
||||||
|
@ -20,6 +20,7 @@ package org.jetbrains.plugins.ideavim
|
|||||||
|
|
||||||
import com.maddyhome.idea.vim.RegisterActions.VIM_ACTIONS_EP
|
import com.maddyhome.idea.vim.RegisterActions.VIM_ACTIONS_EP
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.MappingMode
|
import com.maddyhome.idea.vim.command.MappingMode
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.handler.ActionBeanClass
|
import com.maddyhome.idea.vim.handler.ActionBeanClass
|
||||||
@ -41,9 +42,10 @@ class RegisterActionsTest : VimTestCase() {
|
|||||||
setupChecks {
|
setupChecks {
|
||||||
caretShape = false
|
caretShape = false
|
||||||
}
|
}
|
||||||
|
val keys = injector.parser.parseKeys("jklwB") // just random keys
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = "I jklwB${c}found it in a legendary land"
|
val after = "I jklwB${c}found it in a legendary land"
|
||||||
doTest("jklwB", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.setEnabled(false)
|
VimPlugin.setEnabled(false)
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@ -53,9 +55,10 @@ class RegisterActionsTest : VimTestCase() {
|
|||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test turn plugin off and on`() {
|
fun `test turn plugin off and on`() {
|
||||||
|
val keys = injector.parser.parseKeys("l")
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = "I f${c}ound it in a legendary land"
|
val after = "I f${c}ound it in a legendary land"
|
||||||
doTest("l", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.setEnabled(false)
|
VimPlugin.setEnabled(false)
|
||||||
VimPlugin.setEnabled(true)
|
VimPlugin.setEnabled(true)
|
||||||
}
|
}
|
||||||
@ -63,9 +66,10 @@ class RegisterActionsTest : VimTestCase() {
|
|||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test enable twice`() {
|
fun `test enable twice`() {
|
||||||
|
val keys = injector.parser.parseKeys("l")
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = "I f${c}ound it in a legendary land"
|
val after = "I f${c}ound it in a legendary land"
|
||||||
doTest("l", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.setEnabled(false)
|
VimPlugin.setEnabled(false)
|
||||||
VimPlugin.setEnabled(true)
|
VimPlugin.setEnabled(true)
|
||||||
VimPlugin.setEnabled(true)
|
VimPlugin.setEnabled(true)
|
||||||
@ -74,10 +78,11 @@ class RegisterActionsTest : VimTestCase() {
|
|||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test unregister extension`() {
|
fun `test unregister extension`() {
|
||||||
|
val keys = injector.parser.parseKeys("l")
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = "I f${c}ound it in a legendary land"
|
val after = "I f${c}ound it in a legendary land"
|
||||||
var motionRightAction: ActionBeanClass? = null
|
var motionRightAction: ActionBeanClass? = null
|
||||||
doTest("l", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
motionRightAction = VIM_ACTIONS_EP.extensions().filter { it.actionId == "VimPreviousTabAction" }.findFirst().get()
|
motionRightAction = VIM_ACTIONS_EP.extensions().filter { it.actionId == "VimPreviousTabAction" }.findFirst().get()
|
||||||
|
|
||||||
assertNotNull(getCommandNode())
|
assertNotNull(getCommandNode())
|
||||||
|
@ -229,7 +229,6 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
private fun configureByText(fileName: String, content: String): Editor {
|
private fun configureByText(fileName: String, content: String): Editor {
|
||||||
@Suppress("IdeaVimAssertState")
|
@Suppress("IdeaVimAssertState")
|
||||||
myFixture.configureByText(fileName, content)
|
myFixture.configureByText(fileName, content)
|
||||||
NeovimTesting.setupEditor(myFixture.editor, this)
|
|
||||||
setEditorVisibleSize(screenWidth, screenHeight)
|
setEditorVisibleSize(screenWidth, screenHeight)
|
||||||
return myFixture.editor
|
return myFixture.editor
|
||||||
}
|
}
|
||||||
@ -237,7 +236,6 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
protected fun configureByFileName(fileName: String): Editor {
|
protected fun configureByFileName(fileName: String): Editor {
|
||||||
@Suppress("IdeaVimAssertState")
|
@Suppress("IdeaVimAssertState")
|
||||||
myFixture.configureByText(fileName, "\n")
|
myFixture.configureByText(fileName, "\n")
|
||||||
NeovimTesting.setupEditor(myFixture.editor, this)
|
|
||||||
setEditorVisibleSize(screenWidth, screenHeight)
|
setEditorVisibleSize(screenWidth, screenHeight)
|
||||||
return myFixture.editor
|
return myFixture.editor
|
||||||
}
|
}
|
||||||
@ -300,12 +298,8 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected fun typeText(keys: List<KeyStroke?>): Editor {
|
protected fun typeText(keys: List<KeyStroke?>): Editor {
|
||||||
|
NeovimTesting.typeCommand(keys.filterNotNull().joinToString(separator = "") { injector.parser.toKeyNotation(it) }, this)
|
||||||
val editor = myFixture.editor
|
val editor = myFixture.editor
|
||||||
NeovimTesting.typeCommand(
|
|
||||||
keys.filterNotNull().joinToString(separator = "") { injector.parser.toKeyNotation(it) },
|
|
||||||
this,
|
|
||||||
editor
|
|
||||||
)
|
|
||||||
val project = myFixture.project
|
val project = myFixture.project
|
||||||
when (Checks.keyHandler) {
|
when (Checks.keyHandler) {
|
||||||
Checks.KeyHandlerMethod.DIRECT_TO_VIM -> typeText(keys, editor, project)
|
Checks.KeyHandlerMethod.DIRECT_TO_VIM -> typeText(keys, editor, project)
|
||||||
@ -334,12 +328,6 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
NeovimTesting.assertState(myFixture.editor, this)
|
NeovimTesting.assertState(myFixture.editor, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun assertState(modeAfter: VimStateMachine.Mode, subModeAfter: SubMode) {
|
|
||||||
assertMode(modeAfter)
|
|
||||||
assertSubMode(subModeAfter)
|
|
||||||
assertCaretsVisualAttributes()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun assertPosition(line: Int, column: Int) {
|
fun assertPosition(line: Int, column: Int) {
|
||||||
val carets = myFixture.editor.caretModel.allCarets
|
val carets = myFixture.editor.caretModel.allCarets
|
||||||
Assert.assertEquals("Wrong amount of carets", 1, carets.size)
|
Assert.assertEquals("Wrong amount of carets", 1, carets.size)
|
||||||
@ -471,7 +459,7 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
val actual = getInstance(myFixture.editor).text
|
val actual = getInstance(myFixture.editor).text
|
||||||
Assert.assertNotNull("No Ex output", actual)
|
Assert.assertNotNull("No Ex output", actual)
|
||||||
Assert.assertEquals(expected, actual)
|
Assert.assertEquals(expected, actual)
|
||||||
NeovimTesting.typeCommand("<esc>", this, myFixture.editor)
|
NeovimTesting.typeCommand("<esc>", this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun assertNoExOutput() {
|
fun assertNoExOutput() {
|
||||||
@ -513,46 +501,95 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmOverloads
|
|
||||||
fun doTest(
|
fun doTest(
|
||||||
keys: List<String>,
|
keys: List<String>,
|
||||||
before: String,
|
before: String,
|
||||||
after: String,
|
after: String,
|
||||||
modeAfter: VimStateMachine.Mode = VimStateMachine.Mode.COMMAND,
|
|
||||||
subModeAfter: SubMode = SubMode.NONE,
|
|
||||||
fileType: FileType? = null,
|
|
||||||
fileName: String? = null,
|
|
||||||
afterEditorInitialized: ((Editor) -> Unit)? = null,
|
|
||||||
) {
|
) {
|
||||||
doTest(keys.joinToString(separator = ""), before, after, modeAfter, subModeAfter, fileType, fileName, afterEditorInitialized)
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, SubMode.NONE)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun doTest(
|
||||||
|
keys: List<String>,
|
||||||
|
before: String,
|
||||||
|
after: String,
|
||||||
|
modeAfter: VimStateMachine.Mode,
|
||||||
|
subModeAfter: SubMode,
|
||||||
|
) {
|
||||||
|
doTest(keys.joinToString(separator = ""), before, after, modeAfter, subModeAfter)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmOverloads
|
|
||||||
fun doTest(
|
fun doTest(
|
||||||
keys: String,
|
keys: String,
|
||||||
before: String,
|
before: String,
|
||||||
after: String,
|
after: String,
|
||||||
modeAfter: VimStateMachine.Mode = VimStateMachine.Mode.COMMAND,
|
modeAfter: VimStateMachine.Mode,
|
||||||
subModeAfter: SubMode = SubMode.NONE,
|
subModeAfter: SubMode,
|
||||||
fileType: FileType? = null,
|
|
||||||
fileName: String? = null,
|
|
||||||
afterEditorInitialized: ((Editor) -> Unit)? = null,
|
|
||||||
) {
|
) {
|
||||||
if (fileName != null) {
|
|
||||||
configureByText(fileName, before)
|
|
||||||
} else if (fileType != null) {
|
|
||||||
configureByText(fileType, before)
|
|
||||||
} else {
|
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
}
|
|
||||||
afterEditorInitialized?.invoke(myFixture.editor)
|
|
||||||
performTest(keys, after, modeAfter, subModeAfter)
|
performTest(keys, after, modeAfter, subModeAfter)
|
||||||
|
|
||||||
|
NeovimTesting.assertState(myFixture.editor, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun doTest(
|
||||||
|
keys: String,
|
||||||
|
before: String,
|
||||||
|
after: String,
|
||||||
|
modeAfter: VimStateMachine.Mode,
|
||||||
|
subModeAfter: SubMode,
|
||||||
|
fileType: FileType,
|
||||||
|
) {
|
||||||
|
configureByText(fileType, before)
|
||||||
|
|
||||||
|
NeovimTesting.setupEditor(myFixture.editor, this)
|
||||||
|
NeovimTesting.typeCommand(keys, this)
|
||||||
|
|
||||||
|
performTest(keys, after, modeAfter, subModeAfter)
|
||||||
|
|
||||||
|
NeovimTesting.assertState(myFixture.editor, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun doTest(
|
||||||
|
keys: String,
|
||||||
|
before: String,
|
||||||
|
after: String,
|
||||||
|
modeAfter: VimStateMachine.Mode,
|
||||||
|
subModeAfter: SubMode,
|
||||||
|
fileName: String,
|
||||||
|
) {
|
||||||
|
configureByText(fileName, before)
|
||||||
|
|
||||||
|
NeovimTesting.setupEditor(myFixture.editor, this)
|
||||||
|
NeovimTesting.typeCommand(keys, this)
|
||||||
|
|
||||||
|
performTest(keys, after, modeAfter, subModeAfter)
|
||||||
|
|
||||||
|
NeovimTesting.assertState(myFixture.editor, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun performTest(keys: String, after: String, modeAfter: VimStateMachine.Mode, subModeAfter: SubMode) {
|
protected fun performTest(keys: String, after: String, modeAfter: VimStateMachine.Mode, subModeAfter: SubMode) {
|
||||||
typeText(injector.parser.parseKeys(keys))
|
typeText(injector.parser.parseKeys(keys))
|
||||||
PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
|
PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
|
||||||
assertState(after)
|
@Suppress("IdeaVimAssertState")
|
||||||
|
myFixture.checkResult(after)
|
||||||
|
assertState(modeAfter, subModeAfter)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun doTest(
|
||||||
|
keys: List<KeyStroke>,
|
||||||
|
before: String,
|
||||||
|
after: String?,
|
||||||
|
modeAfter: VimStateMachine.Mode,
|
||||||
|
subModeAfter: SubMode,
|
||||||
|
afterEditorInitialized: (Editor) -> Unit,
|
||||||
|
) {
|
||||||
|
configureByText(before)
|
||||||
|
afterEditorInitialized(myFixture.editor)
|
||||||
|
typeText(keys)
|
||||||
|
@Suppress("IdeaVimAssertState")
|
||||||
|
myFixture.checkResult(after!!)
|
||||||
assertState(modeAfter, subModeAfter)
|
assertState(modeAfter, subModeAfter)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,6 +598,12 @@ abstract class VimTestCase : UsefulTestCase() {
|
|||||||
NeovimTesting.setRegister(register, keys, this)
|
NeovimTesting.setRegister(register, keys, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected fun assertState(modeAfter: VimStateMachine.Mode, subModeAfter: SubMode) {
|
||||||
|
assertMode(modeAfter)
|
||||||
|
assertSubMode(subModeAfter)
|
||||||
|
assertCaretsVisualAttributes()
|
||||||
|
}
|
||||||
|
|
||||||
protected val fileManager: FileEditorManagerEx
|
protected val fileManager: FileEditorManagerEx
|
||||||
get() = FileEditorManagerEx.getInstanceEx(myFixture.project)
|
get() = FileEditorManagerEx.getInstanceEx(myFixture.project)
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -131,6 +131,7 @@ class RepeatChangeActionTest : VimTestCase() {
|
|||||||
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test multicaret`() {
|
fun `test multicaret`() {
|
||||||
val keys = listOf("v2erXj^", ".")
|
val keys = listOf("v2erXj^", ".")
|
||||||
val before = """
|
val before = """
|
||||||
|
@ -41,8 +41,7 @@ class UndoActionTest : VimTestCase() {
|
|||||||
assertFalse(editor.caretModel.primaryCaret.hasSelection())
|
assertFalse(editor.caretModel.primaryCaret.hasSelection())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not yet supported
|
fun `test undo after selection`() {
|
||||||
fun `undo after selection`() {
|
|
||||||
val keys = listOf("v3eld", "u")
|
val keys = listOf("v3eld", "u")
|
||||||
val before = """
|
val before = """
|
||||||
A Discovery
|
A Discovery
|
||||||
|
@ -23,6 +23,8 @@ package org.jetbrains.plugins.ideavim.action.change.change
|
|||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class ChangeVisualActionTest : VimTestCase() {
|
class ChangeVisualActionTest : VimTestCase() {
|
||||||
@ -153,6 +155,7 @@ class ChangeVisualActionTest : VimTestCase() {
|
|||||||
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test change visual action`() {
|
fun `test change visual action`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("v2lc" + "aaa" + "<ESC>"),
|
injector.parser.parseKeys("v2lc" + "aaa" + "<ESC>"),
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
|
||||||
* Copyright (C) 2003-2022 The IdeaVim authors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.plugins.ideavim.action.change.change
|
|
||||||
|
|
||||||
//class InsertRegisterTest : VimTestCase() {
|
|
||||||
// todo test cursor position VIM-2732
|
|
||||||
// fun `test multiline insert from expression register`() {
|
|
||||||
// val keys = "VjyGo<C-r>=@\"<CR>"
|
|
||||||
// val before = """
|
|
||||||
// A Discovery
|
|
||||||
//
|
|
||||||
// ${c}I found it in a legendary land
|
|
||||||
// all rocks and lavender and tufted grass,
|
|
||||||
// where it was settled on some sodden sand
|
|
||||||
// hard by the torrent of a mountain pass.
|
|
||||||
// """.trimIndent()
|
|
||||||
// val after = """
|
|
||||||
// A Discovery
|
|
||||||
//
|
|
||||||
// I found it in a legendary land
|
|
||||||
// all rocks and lavender and tufted grass,
|
|
||||||
// where it was settled on some sodden sand
|
|
||||||
// hard by the torrent of a mountain pass.
|
|
||||||
// I found it in a legendary land
|
|
||||||
// all rocks and lavender and tufted grass,
|
|
||||||
// ${c}
|
|
||||||
// """.trimIndent()
|
|
||||||
// doTest(keys, before, after, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
|
||||||
// }
|
|
||||||
//}
|
|
@ -20,6 +20,8 @@ package org.jetbrains.plugins.ideavim.action.change.change.number
|
|||||||
|
|
||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,6 +114,7 @@ class ChangeVisualNumberDecActionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test change number dec visual action`() {
|
fun `test change number dec visual action`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("Vj<C-X>"),
|
injector.parser.parseKeys("Vj<C-X>"),
|
||||||
|
@ -20,6 +20,8 @@ package org.jetbrains.plugins.ideavim.action.change.change.number
|
|||||||
|
|
||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,6 +114,7 @@ class ChangeVisualNumberIncActionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test change number inc visual multiple cursor`() {
|
fun `test change number inc visual multiple cursor`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("Vj<C-A>"),
|
injector.parser.parseKeys("Vj<C-A>"),
|
||||||
|
@ -92,6 +92,7 @@ class DeleteMotionActionTest : VimTestCase() {
|
|||||||
assertEquals(" expression two\n", savedText)
|
assertEquals(" expression two\n", savedText)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test delete line action multicaret`() {
|
fun `test delete line action multicaret`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("d3d"),
|
injector.parser.parseKeys("d3d"),
|
||||||
@ -109,6 +110,7 @@ class DeleteMotionActionTest : VimTestCase() {
|
|||||||
assertState("${c}abcde\n${c}")
|
assertState("${c}abcde\n${c}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test delete motion action multicaret`() {
|
fun `test delete motion action multicaret`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("dt)"),
|
injector.parser.parseKeys("dt)"),
|
||||||
|
@ -20,9 +20,12 @@ package org.jetbrains.plugins.ideavim.action.change.insert
|
|||||||
|
|
||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class InsertAfterLineEndActionTest : VimTestCase() {
|
class InsertAfterLineEndActionTest : VimTestCase() {
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test insert after line end action`() {
|
fun `test insert after line end action`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("A" + " four" + "<ESC>"),
|
injector.parser.parseKeys("A" + " four" + "<ESC>"),
|
||||||
@ -41,6 +44,7 @@ class InsertAfterLineEndActionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test multiple carets`() {
|
fun `test multiple carets`() {
|
||||||
doTest(
|
doTest(
|
||||||
"AHello<esc>",
|
"AHello<esc>",
|
||||||
|
@ -19,9 +19,12 @@
|
|||||||
package org.jetbrains.plugins.ideavim.action.change.insert
|
package org.jetbrains.plugins.ideavim.action.change.insert
|
||||||
|
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class InsertBeforeFirstNonBlankActionTest : VimTestCase() {
|
class InsertBeforeFirstNonBlankActionTest : VimTestCase() {
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test insert multiple carets`() {
|
fun `test insert multiple carets`() {
|
||||||
doTest(
|
doTest(
|
||||||
"IHello<esc>",
|
"IHello<esc>",
|
||||||
|
@ -23,6 +23,8 @@ package org.jetbrains.plugins.ideavim.action.change.insert
|
|||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class InsertDeletePreviousWordActionTest : VimTestCase() {
|
class InsertDeletePreviousWordActionTest : VimTestCase() {
|
||||||
@ -144,6 +146,7 @@ class InsertDeletePreviousWordActionTest : VimTestCase() {
|
|||||||
assertState("hello\n" + "one two \n")
|
assertState("hello\n" + "one two \n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test insert delete previous word action`() {
|
fun `test insert delete previous word action`() {
|
||||||
typeTextInFile(
|
typeTextInFile(
|
||||||
injector.parser.parseKeys("i" + "<C-W>" + "<ESC>"),
|
injector.parser.parseKeys("i" + "<C-W>" + "<ESC>"),
|
||||||
|
@ -99,6 +99,7 @@ class InsertNewLineAboveActionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test insert new line above with multiple carets`() {
|
fun `test insert new line above with multiple carets`() {
|
||||||
val before = """ I fou${c}nd it in a legendary land
|
val before = """ I fou${c}nd it in a legendary land
|
||||||
| all rocks and laven${c}der and tufted grass,
|
| all rocks and laven${c}der and tufted grass,
|
||||||
|
@ -117,6 +117,7 @@ class InsertNewLineBelowActionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test insert new line below with multiple carets`() {
|
fun `test insert new line below with multiple carets`() {
|
||||||
val before = """ I fou${c}nd it in a legendary land
|
val before = """ I fou${c}nd it in a legendary land
|
||||||
| all rocks and laven${c}der and tufted grass,
|
| all rocks and laven${c}der and tufted grass,
|
||||||
@ -189,7 +190,6 @@ class InsertNewLineBelowActionTest : VimTestCase() {
|
|||||||
performTest("o", after, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
performTest("o", after, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.FOLDING, "Neovim doesn't support arbitrary folds")
|
|
||||||
fun `test insert new line below with folds 2`() {
|
fun `test insert new line below with folds 2`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|${c}all rocks [and lavender and tufted grass,
|
|${c}all rocks [and lavender and tufted grass,
|
||||||
|
@ -28,6 +28,7 @@ import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
|||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class InsertTabActionTest : VimTestCase() {
|
class InsertTabActionTest : VimTestCase() {
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test insert tab`() {
|
fun `test insert tab`() {
|
||||||
setupChecks {
|
setupChecks {
|
||||||
keyHandler = Checks.KeyHandlerMethod.DIRECT_TO_VIM
|
keyHandler = Checks.KeyHandlerMethod.DIRECT_TO_VIM
|
||||||
|
@ -57,6 +57,7 @@ class VisualBlockAppendActionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test append in non block mode`() {
|
fun `test append in non block mode`() {
|
||||||
doTest(
|
doTest(
|
||||||
"vwAHello<esc>",
|
"vwAHello<esc>",
|
||||||
|
@ -73,7 +73,9 @@ Xbar
|
|||||||
|
|
||||||
ba_quux_r
|
ba_quux_r
|
||||||
|
|
||||||
""".trimIndent()
|
""".trimIndent(),
|
||||||
|
VimStateMachine.Mode.COMMAND,
|
||||||
|
VimStateMachine.SubMode.NONE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +97,9 @@ Xbar
|
|||||||
quux spam eggs
|
quux spam eggs
|
||||||
|
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
),
|
||||||
|
VimStateMachine.Mode.COMMAND,
|
||||||
|
VimStateMachine.SubMode.NONE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +136,9 @@ Xbar
|
|||||||
ba_quux_r
|
ba_quux_r
|
||||||
|
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
),
|
||||||
|
VimStateMachine.Mode.COMMAND,
|
||||||
|
VimStateMachine.SubMode.NONE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +162,10 @@ Xbar
|
|||||||
where it was settled on some sodden sand
|
where it was settled on some sodden sand
|
||||||
hard by the torrent of a mountain pass.
|
hard by the torrent of a mountain pass.
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
|
VimStateMachine.Mode.COMMAND,
|
||||||
|
VimStateMachine.SubMode.NONE
|
||||||
)
|
)
|
||||||
|
assertMode(VimStateMachine.Mode.COMMAND)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(SkipNeovimReason.VISUAL_BLOCK_MODE)
|
@TestWithoutNeovim(SkipNeovimReason.VISUAL_BLOCK_MODE)
|
||||||
@ -170,7 +179,7 @@ Xbar
|
|||||||
hard by the torrent of a mountain pass.
|
hard by the torrent of a mountain pass.
|
||||||
"""
|
"""
|
||||||
doTest(
|
doTest(
|
||||||
listOf("<C-V>" + "jjI" + " Hello " + "<ESC>"),
|
injector.parser.parseKeys("<C-V>" + "jjI" + " Hello " + "<ESC>"),
|
||||||
before.trimIndent(),
|
before.trimIndent(),
|
||||||
"""
|
"""
|
||||||
A Discovery
|
A Discovery
|
||||||
@ -180,11 +189,14 @@ Xbar
|
|||||||
where it was s Hello ettled on some sodden sand
|
where it was s Hello ettled on some sodden sand
|
||||||
hard by the torrent of a mountain pass.
|
hard by the torrent of a mountain pass.
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
|
VimStateMachine.Mode.COMMAND,
|
||||||
|
VimStateMachine.SubMode.NONE
|
||||||
) {
|
) {
|
||||||
it.inlayModel.addInlineElement(before.indexOf("found"), HintRenderer("Hello"))
|
it.inlayModel.addInlineElement(before.indexOf("found"), HintRenderer("Hello"))
|
||||||
it.inlayModel.addInlineElement(before.indexOf("l rocks"), HintRenderer("Hello"))
|
it.inlayModel.addInlineElement(before.indexOf("l rocks"), HintRenderer("Hello"))
|
||||||
it.inlayModel.addInlineElement(before.indexOf("ere it"), HintRenderer("Hello"))
|
it.inlayModel.addInlineElement(before.indexOf("ere it"), HintRenderer("Hello"))
|
||||||
}
|
}
|
||||||
|
assertMode(VimStateMachine.Mode.COMMAND)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(SkipNeovimReason.VISUAL_BLOCK_MODE)
|
@TestWithoutNeovim(SkipNeovimReason.VISUAL_BLOCK_MODE)
|
||||||
|
@ -24,6 +24,8 @@ import com.maddyhome.idea.vim.command.SelectionType
|
|||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
import com.maddyhome.idea.vim.newapi.vim
|
import com.maddyhome.idea.vim.newapi.vim
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
import org.jetbrains.plugins.ideavim.rangeOf
|
import org.jetbrains.plugins.ideavim.rangeOf
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@ -76,6 +78,7 @@ class PutTestAfterCursorActionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
@Test
|
@Test
|
||||||
fun `test inserting same content to multiple carets`() {
|
fun `test inserting same content to multiple carets`() {
|
||||||
val before = """
|
val before = """
|
||||||
|
@ -19,10 +19,13 @@
|
|||||||
package org.jetbrains.plugins.ideavim.action.motion.search
|
package org.jetbrains.plugins.ideavim.action.motion.search
|
||||||
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
|
import com.maddyhome.idea.vim.api.injector
|
||||||
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.common.Direction
|
import com.maddyhome.idea.vim.common.Direction
|
||||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
import javax.swing.KeyStroke
|
||||||
|
|
||||||
class SearchAgainPreviousActionTest : VimTestCase() {
|
class SearchAgainPreviousActionTest : VimTestCase() {
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
@ -33,13 +36,14 @@ class SearchAgainPreviousActionTest : VimTestCase() {
|
|||||||
...${c}all it was settled on some sodden sand
|
...${c}all it was settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
|
val keys = injector.parser.parseKeys("N")
|
||||||
val after = """
|
val after = """
|
||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
...${c}all rocks and lavender and tufted grass,
|
...${c}all rocks and lavender and tufted grass,
|
||||||
...all it was settled on some sodden sand
|
...all it was settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
doTestWithSearch("N", before, after)
|
doTestWithSearch(keys, before, after)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
@ -50,13 +54,14 @@ class SearchAgainPreviousActionTest : VimTestCase() {
|
|||||||
...all it was .${c}all settled on some sodden sand
|
...all it was .${c}all settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
|
val keys = injector.parser.parseKeys("N")
|
||||||
val after = """
|
val after = """
|
||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
...all rocks and lavender and tufted grass,
|
...all rocks and lavender and tufted grass,
|
||||||
...${c}all it was .all settled on some sodden sand
|
...${c}all it was .all settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
doTestWithSearch("N", before, after)
|
doTestWithSearch(keys, before, after)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
@ -67,13 +72,14 @@ class SearchAgainPreviousActionTest : VimTestCase() {
|
|||||||
...all it was .all.${c}all settled on some sodden sand
|
...all it was .all.${c}all settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
|
val keys = injector.parser.parseKeys("N")
|
||||||
val after = """
|
val after = """
|
||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
...all rocks and lavender and tufted grass,
|
...all rocks and lavender and tufted grass,
|
||||||
...all it was .${c}all.all settled on some sodden sand
|
...all it was .${c}all.all settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
doTestWithSearch("N", before, after)
|
doTestWithSearch(keys, before, after)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
@ -84,13 +90,14 @@ class SearchAgainPreviousActionTest : VimTestCase() {
|
|||||||
...all it was settled on some sodden sand
|
...all it was settled on some sodden sand
|
||||||
...all by the torrent of a mountain pass
|
...all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
|
val keys = injector.parser.parseKeys("N")
|
||||||
val after = """
|
val after = """
|
||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
...all rocks and lavender and tufted grass,
|
...all rocks and lavender and tufted grass,
|
||||||
...all it was settled on some sodden sand
|
...all it was settled on some sodden sand
|
||||||
...${c}all by the torrent of a mountain pass
|
...${c}all by the torrent of a mountain pass
|
||||||
""".trimIndent().dotToTab()
|
""".trimIndent().dotToTab()
|
||||||
doTestWithSearch("N", before, after)
|
doTestWithSearch(keys, before, after)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun `test search previous after search command with offset`() {
|
fun `test search previous after search command with offset`() {
|
||||||
@ -167,8 +174,8 @@ class SearchAgainPreviousActionTest : VimTestCase() {
|
|||||||
doTest(listOf(searchCommand("/land/1"), exCommand("s/and/or"), "G", "N"), before, after)
|
doTest(listOf(searchCommand("/land/1"), exCommand("s/and/or"), "G", "N"), before, after)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doTestWithSearch(keys: String, before: String, after: String) {
|
private fun doTestWithSearch(keys: List<KeyStroke>, before: String, after: String) {
|
||||||
doTest(keys, before, after) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.getSearch().setLastSearchState(it, "all", "", Direction.FORWARDS)
|
VimPlugin.getSearch().setLastSearchState(it, "all", "", Direction.FORWARDS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
|
|
||||||
package org.jetbrains.plugins.ideavim.action.motion.updown
|
package org.jetbrains.plugins.ideavim.action.motion.updown
|
||||||
|
|
||||||
|
import com.maddyhome.idea.vim.api.injector
|
||||||
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.vimLastColumn
|
import com.maddyhome.idea.vim.helper.vimLastColumn
|
||||||
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
@ -34,11 +36,12 @@ class MotionUpActionTest : VimTestCase() {
|
|||||||
I found it in a le${c}gendary land
|
I found it in a le${c}gendary land
|
||||||
all rocks and lavender and tufted grass,
|
all rocks and lavender and tufted grass,
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
doTest(keys, before, after)
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test last column is incorrect`() {
|
fun `test last column is incorrect`() {
|
||||||
|
val keys = injector.parser.parseKeys("k")
|
||||||
val before = """
|
val before = """
|
||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
all rocks and lave${c}nder and tufted grass,
|
all rocks and lave${c}nder and tufted grass,
|
||||||
@ -47,7 +50,7 @@ class MotionUpActionTest : VimTestCase() {
|
|||||||
I found it in a le${c}gendary land
|
I found it in a le${c}gendary land
|
||||||
all rocks and lavender and tufted grass,
|
all rocks and lavender and tufted grass,
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
doTest("k", before, after) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
it.caretModel.primaryCaret.vimLastColumn = 5
|
it.caretModel.primaryCaret.vimLastColumn = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,11 +69,12 @@ class MotionUpActionTest : VimTestCase() {
|
|||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
all rocks and lavender and tufted ${c}grass,
|
all rocks and lavender and tufted ${c}grass,
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
doTest(keys, before, after)
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test last column wrong lastColumn`() {
|
fun `test last column wrong lastColumn`() {
|
||||||
|
val keys = injector.parser.parseKeys("k")
|
||||||
val before = """
|
val before = """
|
||||||
I found it in a legendary land
|
I found it in a legendary land
|
||||||
all rocks and lavender and tufted ${c}grass,
|
all rocks and lavender and tufted ${c}grass,
|
||||||
@ -79,7 +83,7 @@ class MotionUpActionTest : VimTestCase() {
|
|||||||
I found it in a legendary lan${c}d
|
I found it in a legendary lan${c}d
|
||||||
all rocks and lavender and tufted grass,
|
all rocks and lavender and tufted grass,
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
doTest("k", before, after) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
it.caretModel.primaryCaret.vimLastColumn = 0
|
it.caretModel.primaryCaret.vimLastColumn = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ import com.maddyhome.idea.vim.helper.vimSelectionStart
|
|||||||
import com.maddyhome.idea.vim.options.OptionConstants
|
import com.maddyhome.idea.vim.options.OptionConstants
|
||||||
import com.maddyhome.idea.vim.options.OptionScope
|
import com.maddyhome.idea.vim.options.OptionScope
|
||||||
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString
|
import com.maddyhome.idea.vim.vimscript.model.datatypes.VimString
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
import org.jetbrains.plugins.ideavim.rangeOf
|
import org.jetbrains.plugins.ideavim.rangeOf
|
||||||
|
|
||||||
@ -228,6 +230,7 @@ class VisualToggleCharacterModeActionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test enter visual with count after visual operation multicaret`() {
|
fun `test enter visual with count after visual operation multicaret`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("vedx", "1v"),
|
listOf("vedx", "1v"),
|
||||||
|
@ -54,18 +54,20 @@ class CommandParserTest : VimTestCase() {
|
|||||||
setupChecks {
|
setupChecks {
|
||||||
caretShape = false
|
caretShape = false
|
||||||
}
|
}
|
||||||
|
val keys = commandToKeys(">>")
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = "I :>>${c}found it in a legendary land"
|
val after = "I :>>${c}found it in a legendary land"
|
||||||
doTest(exCommand(">>"), before, after) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.setEnabled(false)
|
VimPlugin.setEnabled(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test turn off and on`() {
|
fun `test turn off and on`() {
|
||||||
|
val keys = commandToKeys(">>")
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = " ${c}I found it in a legendary land"
|
val after = " ${c}I found it in a legendary land"
|
||||||
doTest(exCommand(">>"), before, after) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.setEnabled(false)
|
VimPlugin.setEnabled(false)
|
||||||
VimPlugin.setEnabled(true)
|
VimPlugin.setEnabled(true)
|
||||||
}
|
}
|
||||||
@ -73,9 +75,10 @@ class CommandParserTest : VimTestCase() {
|
|||||||
|
|
||||||
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
@TestWithoutNeovim(reason = SkipNeovimReason.EDITOR_MODIFICATION)
|
||||||
fun `test turn off and on twice`() {
|
fun `test turn off and on twice`() {
|
||||||
|
val keys = commandToKeys(">>")
|
||||||
val before = "I ${c}found it in a legendary land"
|
val before = "I ${c}found it in a legendary land"
|
||||||
val after = " ${c}I found it in a legendary land"
|
val after = " ${c}I found it in a legendary land"
|
||||||
doTest(exCommand(">>"), before, after) {
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE) {
|
||||||
VimPlugin.setEnabled(false)
|
VimPlugin.setEnabled(false)
|
||||||
VimPlugin.setEnabled(true)
|
VimPlugin.setEnabled(true)
|
||||||
VimPlugin.setEnabled(true)
|
VimPlugin.setEnabled(true)
|
||||||
|
@ -68,6 +68,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testJoinLines() {
|
fun testJoinLines() {
|
||||||
val before = "qwe\n" + "r${c}ty\n" + "asd\n" + "fg${c}h\n" + "zxc\n" + "vbn\n"
|
val before = "qwe\n" + "r${c}ty\n" + "asd\n" + "fg${c}h\n" + "zxc\n" + "vbn\n"
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
@ -85,6 +86,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
// myFixture.checkResult(after)
|
// myFixture.checkResult(after)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testCopyText() {
|
fun testCopyText() {
|
||||||
val before = "qwe\n" + "rty\n" + "a${c}sd\n" + "fg${c}h\n" + "zxc\n" + "vbn\n"
|
val before = "qwe\n" + "rty\n" + "a${c}sd\n" + "fg${c}h\n" + "zxc\n" + "vbn\n"
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
@ -102,6 +104,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
// myFixture.checkResult(after)
|
// myFixture.checkResult(after)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testPutText() {
|
fun testPutText() {
|
||||||
// This test produces double ${c}zxc on 3rd line if non-idea paste is used
|
// This test produces double ${c}zxc on 3rd line if non-idea paste is used
|
||||||
val before = """
|
val before = """
|
||||||
@ -170,6 +173,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
// myFixture.checkResult(after)
|
// myFixture.checkResult(after)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testMoveTextBeforeCarets() {
|
fun testMoveTextBeforeCarets() {
|
||||||
val before = "qwe\n" + "rty\n" + "${c}asd\n" + "fgh\n" + "z${c}xc\n" + "vbn\n"
|
val before = "qwe\n" + "rty\n" + "${c}asd\n" + "fgh\n" + "z${c}xc\n" + "vbn\n"
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
@ -178,6 +182,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testMoveTextAfterCarets() {
|
fun testMoveTextAfterCarets() {
|
||||||
val before = "q${c}we\n" + "rty\n" + "${c}asd\n" + "fgh\n" + "zxc\n" + "vbn\n"
|
val before = "q${c}we\n" + "rty\n" + "${c}asd\n" + "fgh\n" + "zxc\n" + "vbn\n"
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
@ -186,6 +191,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testMoveTextBetweenCarets() {
|
fun testMoveTextBetweenCarets() {
|
||||||
val before = "q${c}we\n" + "rty\n" + "${c}asd\n" + "fgh\n" + "zxc\n" + "vbn\n"
|
val before = "q${c}we\n" + "rty\n" + "${c}asd\n" + "fgh\n" + "zxc\n" + "vbn\n"
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
@ -194,6 +200,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testYankLines() {
|
fun testYankLines() {
|
||||||
val before = """qwe
|
val before = """qwe
|
||||||
|rt${c}y
|
|rt${c}y
|
||||||
@ -223,6 +230,7 @@ class MultipleCaretsTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun testDeleteLines() {
|
fun testDeleteLines() {
|
||||||
val before = """qwe
|
val before = """qwe
|
||||||
|r${c}ty
|
|r${c}ty
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
package org.jetbrains.plugins.ideavim.ex.implementation.commands
|
package org.jetbrains.plugins.ideavim.ex.implementation.commands
|
||||||
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin
|
import com.maddyhome.idea.vim.VimPlugin
|
||||||
import com.maddyhome.idea.vim.api.injector
|
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,22 +130,6 @@ class CmdCommandTest : VimTestCase() {
|
|||||||
assertPluginError(false)
|
assertPluginError(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun `test add command with range`() {
|
|
||||||
VimPlugin.getCommand().resetAliases()
|
|
||||||
configureByText("\n")
|
|
||||||
typeText(commandToKeys("command! -range Error echo <args>"))
|
|
||||||
assertPluginError(false)
|
|
||||||
assertEquals("'-range' is not supported by `command`", injector.messages.getStatusBarMessage())
|
|
||||||
}
|
|
||||||
|
|
||||||
fun `test add command with complete`() {
|
|
||||||
VimPlugin.getCommand().resetAliases()
|
|
||||||
configureByText("\n")
|
|
||||||
typeText(commandToKeys("command! -complete=color Error echo <args>"))
|
|
||||||
assertPluginError(false)
|
|
||||||
assertEquals("'-complete' is not supported by `command`", injector.messages.getStatusBarMessage())
|
|
||||||
}
|
|
||||||
|
|
||||||
fun `test add command with arguments short`() {
|
fun `test add command with arguments short`() {
|
||||||
VimPlugin.getCommand().resetAliases()
|
VimPlugin.getCommand().resetAliases()
|
||||||
configureByText("\n")
|
configureByText("\n")
|
||||||
|
@ -21,6 +21,8 @@ package org.jetbrains.plugins.ideavim.ex.implementation.commands
|
|||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class JoinLinesCommandTest : VimTestCase() {
|
class JoinLinesCommandTest : VimTestCase() {
|
||||||
@ -95,6 +97,7 @@ class JoinLinesCommandTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test join multicaret`() {
|
fun `test join multicaret`() {
|
||||||
configureByText(
|
configureByText(
|
||||||
"""
|
"""
|
||||||
|
@ -102,6 +102,7 @@ class ShiftLeftCommandTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test multiple carets`() {
|
fun `test multiple carets`() {
|
||||||
val before = """ I found it in a legendary land
|
val before = """ I found it in a legendary land
|
||||||
|${c}all rocks and lavender and tufted grass,
|
|${c}all rocks and lavender and tufted grass,
|
||||||
|
@ -83,6 +83,7 @@ class ShiftRightCommandTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.MULTICARET)
|
||||||
fun `test multiple carets`() {
|
fun `test multiple carets`() {
|
||||||
val before = """ I found it in a legendary land
|
val before = """ I found it in a legendary land
|
||||||
|${c}all rocks and lavender and tufted grass,
|
|${c}all rocks and lavender and tufted grass,
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
|
||||||
* Copyright (C) 2003-2022 The IdeaVim authors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.plugins.ideavim.ex.implementation.expressions
|
|
||||||
|
|
||||||
import com.maddyhome.idea.vim.helper.StringHelper.parseKeys
|
|
||||||
import com.maddyhome.idea.vim.vimscript.model.expressions.Register
|
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
|
||||||
import org.jetbrains.plugins.ideavim.ex.evaluate
|
|
||||||
|
|
||||||
class ExpressionTest: VimTestCase() {
|
|
||||||
|
|
||||||
fun `test multiline register content`() {
|
|
||||||
configureByText("${c}Oh\nHi\nMark\n")
|
|
||||||
typeText(parseKeys("VGy"))
|
|
||||||
assertEquals("Oh\nHi\nMark\n", Register('"').evaluate().toString())
|
|
||||||
}
|
|
||||||
}
|
|
@ -41,6 +41,8 @@ import com.maddyhome.idea.vim.newapi.ij
|
|||||||
import com.maddyhome.idea.vim.newapi.vim
|
import com.maddyhome.idea.vim.newapi.vim
|
||||||
import com.maddyhome.idea.vim.options.OptionScope
|
import com.maddyhome.idea.vim.options.OptionScope
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class OpMappingTest : VimTestCase() {
|
class OpMappingTest : VimTestCase() {
|
||||||
@ -66,6 +68,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
super.tearDown()
|
super.tearDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test simple delete`() {
|
fun `test simple delete`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dI",
|
"dI",
|
||||||
@ -76,6 +79,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test simple delete backwards`() {
|
fun `test simple delete backwards`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dP",
|
"dP",
|
||||||
@ -86,6 +90,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete emulate inclusive`() {
|
fun `test delete emulate inclusive`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dU",
|
"dU",
|
||||||
@ -96,6 +101,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test linewise delete`() {
|
fun `test linewise delete`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dO",
|
"dO",
|
||||||
@ -118,6 +124,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test disable extension via set`() {
|
fun `test disable extension via set`() {
|
||||||
configureByText("${c}I found it in a legendary land")
|
configureByText("${c}I found it in a legendary land")
|
||||||
typeText(injector.parser.parseKeys("Q"))
|
typeText(injector.parser.parseKeys("Q"))
|
||||||
@ -132,6 +139,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
assertState("I ${c}found it in a legendary land")
|
assertState("I ${c}found it in a legendary land")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test disable extension as extension point`() {
|
fun `test disable extension as extension point`() {
|
||||||
configureByText("${c}I found it in a legendary land")
|
configureByText("${c}I found it in a legendary land")
|
||||||
typeText(injector.parser.parseKeys("Q"))
|
typeText(injector.parser.parseKeys("Q"))
|
||||||
@ -150,6 +158,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
assertState("I ${c}found it in a legendary land")
|
assertState("I ${c}found it in a legendary land")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test disable disposed extension`() {
|
fun `test disable disposed extension`() {
|
||||||
configureByText("${c}I found it in a legendary land")
|
configureByText("${c}I found it in a legendary land")
|
||||||
typeText(injector.parser.parseKeys("Q"))
|
typeText(injector.parser.parseKeys("Q"))
|
||||||
@ -167,6 +176,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
assertState("I ${c}found it in a legendary land")
|
assertState("I ${c}found it in a legendary land")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test delayed action`() {
|
fun `test delayed action`() {
|
||||||
configureByText("${c}I found it in a legendary land")
|
configureByText("${c}I found it in a legendary land")
|
||||||
typeText(injector.parser.parseKeys("R"))
|
typeText(injector.parser.parseKeys("R"))
|
||||||
@ -181,6 +191,7 @@ class OpMappingTest : VimTestCase() {
|
|||||||
/**
|
/**
|
||||||
* This test tests an intentionally incorrectly implemented action
|
* This test tests an intentionally incorrectly implemented action
|
||||||
*/
|
*/
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test delayed incorrect action`() {
|
fun `test delayed incorrect action`() {
|
||||||
configureByText("${c}I found it in a legendary land")
|
configureByText("${c}I found it in a legendary land")
|
||||||
typeText(injector.parser.parseKeys("E"))
|
typeText(injector.parser.parseKeys("E"))
|
||||||
@ -210,18 +221,21 @@ class PlugExtensionsTest : VimTestCase() {
|
|||||||
super.tearDown()
|
super.tearDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test enable via plug`() {
|
fun `test enable via plug`() {
|
||||||
injector.vimscriptExecutor.execute("Plug 'MyTest'", false)
|
injector.vimscriptExecutor.execute("Plug 'MyTest'", false)
|
||||||
|
|
||||||
assertTrue(extension.ext.initialized)
|
assertTrue(extension.ext.initialized)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test enable via plugin`() {
|
fun `test enable via plugin`() {
|
||||||
injector.vimscriptExecutor.execute("Plugin 'MyTest'", false)
|
injector.vimscriptExecutor.execute("Plugin 'MyTest'", false)
|
||||||
|
|
||||||
assertTrue(extension.ext.initialized)
|
assertTrue(extension.ext.initialized)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test enable via plug and disable via set`() {
|
fun `test enable via plug and disable via set`() {
|
||||||
injector.vimscriptExecutor.execute("Plug 'MyTest'")
|
injector.vimscriptExecutor.execute("Plug 'MyTest'")
|
||||||
injector.vimscriptExecutor.execute("set noTestExtension")
|
injector.vimscriptExecutor.execute("set noTestExtension")
|
||||||
@ -247,6 +261,7 @@ class PlugMissingKeysTest : VimTestCase() {
|
|||||||
super.tearDown()
|
super.tearDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test missing keys`() {
|
fun `test missing keys`() {
|
||||||
executeLikeVimrc(
|
executeLikeVimrc(
|
||||||
"map myKey <Plug>TestMissing",
|
"map myKey <Plug>TestMissing",
|
||||||
@ -262,6 +277,7 @@ class PlugMissingKeysTest : VimTestCase() {
|
|||||||
TestCase.assertEquals(injector.parser.parseKeys("L"), iKeyMappings.first().first)
|
TestCase.assertEquals(injector.parser.parseKeys("L"), iKeyMappings.first().first)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test missing keys enable plugin first`() {
|
fun `test missing keys enable plugin first`() {
|
||||||
executeLikeVimrc(
|
executeLikeVimrc(
|
||||||
"Plug 'MyTest'",
|
"Plug 'MyTest'",
|
||||||
@ -277,6 +293,7 @@ class PlugMissingKeysTest : VimTestCase() {
|
|||||||
TestCase.assertEquals(injector.parser.parseKeys("L"), iKeyMappings.first().first)
|
TestCase.assertEquals(injector.parser.parseKeys("L"), iKeyMappings.first().first)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test packadd`() {
|
fun `test packadd`() {
|
||||||
assertFalse(injector.optionService.isSet(OptionScope.GLOBAL, "matchit"))
|
assertFalse(injector.optionService.isSet(OptionScope.GLOBAL, "matchit"))
|
||||||
executeLikeVimrc(
|
executeLikeVimrc(
|
||||||
@ -286,6 +303,7 @@ class PlugMissingKeysTest : VimTestCase() {
|
|||||||
assertTrue(injector.optionService.isSet(OptionScope.GLOBAL, "matchit"))
|
assertTrue(injector.optionService.isSet(OptionScope.GLOBAL, "matchit"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test packadd ex`() {
|
fun `test packadd ex`() {
|
||||||
assertFalse(injector.optionService.isSet(OptionScope.GLOBAL, "matchit"))
|
assertFalse(injector.optionService.isSet(OptionScope.GLOBAL, "matchit"))
|
||||||
executeLikeVimrc(
|
executeLikeVimrc(
|
||||||
|
@ -22,6 +22,8 @@ import com.google.common.collect.Lists;
|
|||||||
import com.maddyhome.idea.vim.api.VimInjectorKt;
|
import com.maddyhome.idea.vim.api.VimInjectorKt;
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine;
|
import com.maddyhome.idea.vim.command.VimStateMachine;
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers;
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers;
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason;
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim;
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase;
|
import org.jetbrains.plugins.ideavim.VimTestCase;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -39,7 +41,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimInjectorKt.getInjector().getVimscriptExecutor().execute("let argtextobj_pairs='" + value + "'", true);
|
VimInjectorKt.getInjector().getVimscriptExecutor().execute("let argtextobj_pairs='" + value + "'", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testDeleteAnArgument() {
|
public void testDeleteAnArgument() {
|
||||||
doTest(Lists.newArrayList("daa"), "function(int arg1, char<caret>* arg2=\"a,b,c(d,e)\")",
|
doTest(Lists.newArrayList("daa"), "function(int arg1, char<caret>* arg2=\"a,b,c(d,e)\")",
|
||||||
"function(int arg1<caret>)", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"function(int arg1<caret>)", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -47,11 +49,13 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testChangeInnerArgument() {
|
public void testChangeInnerArgument() {
|
||||||
doTest(Lists.newArrayList("cia"), "function(int arg1, char<caret>* arg2=\"a,b,c(d,e)\")",
|
doTest(Lists.newArrayList("cia"), "function(int arg1, char<caret>* arg2=\"a,b,c(d,e)\")",
|
||||||
"function(int arg1, <caret>)", VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE);
|
"function(int arg1, <caret>)", VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testSmartArgumentRecognition() {
|
public void testSmartArgumentRecognition() {
|
||||||
doTest(Lists.newArrayList("dia"), "function(1, (20<caret>*30)+40, somefunc2(3, 4))",
|
doTest(Lists.newArrayList("dia"), "function(1, (20<caret>*30)+40, somefunc2(3, 4))",
|
||||||
"function(1, <caret>, somefunc2(3, 4))", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"function(1, <caret>, somefunc2(3, 4))", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -59,6 +63,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
"function(1, (20*30)+40, somefunc2(<caret>4))", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"function(1, (20*30)+40, somefunc2(<caret>4))", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testIgnoreQuotedArguments() {
|
public void testIgnoreQuotedArguments() {
|
||||||
doTest(Lists.newArrayList("daa"), "function(int arg1, char* arg2=a,b,c(<caret>arg,e))",
|
doTest(Lists.newArrayList("daa"), "function(int arg1, char* arg2=a,b,c(<caret>arg,e))",
|
||||||
"function(int arg1, char* arg2=a,b,c(<caret>e))", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"function(int arg1, char* arg2=a,b,c(<caret>e))", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -70,6 +75,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
"function(int arg1<caret>)", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"function(int arg1<caret>)", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testDeleteTwoArguments() {
|
public void testDeleteTwoArguments() {
|
||||||
doTest(Lists.newArrayList("d2aa"), "function(int <caret>arg1, char* arg2=\"a,b,c(d,e)\")", "function(<caret>)",
|
doTest(Lists.newArrayList("d2aa"), "function(int <caret>arg1, char* arg2=\"a,b,c(d,e)\")", "function(<caret>)",
|
||||||
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -85,6 +91,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
"function(int arg1, <caret>)", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"function(int arg1, <caret>)", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testSelectTwoArguments() {
|
public void testSelectTwoArguments() {
|
||||||
doTest(Lists.newArrayList("v2aa"), "function(int <caret>arg1, char* arg2=\"a,b,c(d,e)\", bool arg3)",
|
doTest(Lists.newArrayList("v2aa"), "function(int <caret>arg1, char* arg2=\"a,b,c(d,e)\", bool arg3)",
|
||||||
"function(<selection>int arg1, char* arg2=\"a,b,c(d,e)\", </selection>bool arg3)",
|
"function(<selection>int arg1, char* arg2=\"a,b,c(d,e)\", </selection>bool arg3)",
|
||||||
@ -94,12 +101,14 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER);
|
VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testArgumentsInsideAngleBrackets() {
|
public void testArgumentsInsideAngleBrackets() {
|
||||||
setArgTextObjPairsVariable("(:),<:>");
|
setArgTextObjPairsVariable("(:),<:>");
|
||||||
doTest(Lists.newArrayList("dia"), "std::vector<int, std::unique_p<caret>tr<bool>> v{};",
|
doTest(Lists.newArrayList("dia"), "std::vector<int, std::unique_p<caret>tr<bool>> v{};",
|
||||||
"std::vector<int, <caret>> v{};", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"std::vector<int, <caret>> v{};", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testWhenUnbalancedHigherPriorityPairIsUsed() {
|
public void testWhenUnbalancedHigherPriorityPairIsUsed() {
|
||||||
setArgTextObjPairsVariable("{:},(:)");
|
setArgTextObjPairsVariable("{:},(:)");
|
||||||
doTest(Lists.newArrayList("dia"), "namespace foo { void foo(int arg1, bool arg2<caret> { body }\n}",
|
doTest(Lists.newArrayList("dia"), "namespace foo { void foo(int arg1, bool arg2<caret> { body }\n}",
|
||||||
@ -108,6 +117,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
"namespace foo { <caret>, bool arg2 { body }\n}", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"namespace foo { <caret>, bool arg2 { body }\n}", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testBracketPriorityToHangleShiftOperators() {
|
public void testBracketPriorityToHangleShiftOperators() {
|
||||||
doTest(Lists.newArrayList("dia"), "foo(30 << 10, 20 << <caret>3) >> 17", "foo(30 << 10, <caret>) >> 17",
|
doTest(Lists.newArrayList("dia"), "foo(30 << 10, 20 << <caret>3) >> 17", "foo(30 << 10, <caret>) >> 17",
|
||||||
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -117,6 +127,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testEmptyFile() {
|
public void testEmptyFile() {
|
||||||
assertPluginError(false);
|
assertPluginError(false);
|
||||||
doTest(Lists.newArrayList("daa"), "<caret>", "<caret>", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
doTest(Lists.newArrayList("daa"), "<caret>", "<caret>", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -125,6 +136,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
assertPluginError(true);
|
assertPluginError(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testEmptyLine() {
|
public void testEmptyLine() {
|
||||||
assertPluginError(false);
|
assertPluginError(false);
|
||||||
doTest(Lists.newArrayList("daa"), "<caret>\n", "<caret>\n", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
doTest(Lists.newArrayList("daa"), "<caret>\n", "<caret>\n", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -133,6 +145,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
assertPluginError(true);
|
assertPluginError(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testEmptyArg() {
|
public void testEmptyArg() {
|
||||||
assertPluginError(false);
|
assertPluginError(false);
|
||||||
doTest(Lists.newArrayList("daa"), "foo(<caret>)", "foo(<caret>)", VimStateMachine.Mode.COMMAND,
|
doTest(Lists.newArrayList("daa"), "foo(<caret>)", "foo(<caret>)", VimStateMachine.Mode.COMMAND,
|
||||||
@ -143,6 +156,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
assertPluginError(true);
|
assertPluginError(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testSkipCommasInsideNestedPairs() {
|
public void testSkipCommasInsideNestedPairs() {
|
||||||
final String before =
|
final String before =
|
||||||
"void foo(int arg1)\n{" + " methodCall(arg1, \"{ arg1 , 2\");\n" + " otherMeth<caret>odcall(arg, 3);\n" + "}";
|
"void foo(int arg1)\n{" + " methodCall(arg1, \"{ arg1 , 2\");\n" + " otherMeth<caret>odcall(arg, 3);\n" + "}";
|
||||||
@ -150,16 +164,19 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
assertPluginError(true);
|
assertPluginError(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testHandleNestedPairs() {
|
public void testHandleNestedPairs() {
|
||||||
doTest(Lists.newArrayList("dia"), "foo(arg1, arr<caret>ay[someexpr(Class{arg1 << 3, arg2})] + 3)\n{",
|
doTest(Lists.newArrayList("dia"), "foo(arg1, arr<caret>ay[someexpr(Class{arg1 << 3, arg2})] + 3)\n{",
|
||||||
"foo(arg1, <caret>)\n{", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
"foo(arg1, <caret>)\n{", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testHandleNestedParenthesisForASingleArgument() {
|
public void testHandleNestedParenthesisForASingleArgument() {
|
||||||
doTest(Lists.newArrayList("dia"), "foo((20*<caret>30))", "foo(<caret>)", VimStateMachine.Mode.COMMAND,
|
doTest(Lists.newArrayList("dia"), "foo((20*<caret>30))", "foo(<caret>)", VimStateMachine.Mode.COMMAND,
|
||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testHandleImbalancedPairs() {
|
public void testHandleImbalancedPairs() {
|
||||||
doTest(Lists.newArrayList("dia"), "foo(arg1, ba<caret>r(not-an-arg{body", "foo(arg1, ba<caret>r(not-an-arg{body",
|
doTest(Lists.newArrayList("dia"), "foo(arg1, ba<caret>r(not-an-arg{body", "foo(arg1, ba<caret>r(not-an-arg{body",
|
||||||
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
@ -175,12 +192,14 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
assertPluginError(true);
|
assertPluginError(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testArgumentBoundsSearchIsLimitedByLineCount() {
|
public void testArgumentBoundsSearchIsLimitedByLineCount() {
|
||||||
final String before = "foo(\n" + String.join("", Collections.nCopies(10, " arg,\n")) + " last<caret>Arg" + ")";
|
final String before = "foo(\n" + String.join("", Collections.nCopies(10, " arg,\n")) + " last<caret>Arg" + ")";
|
||||||
doTest(Lists.newArrayList("dia"), before, before, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
doTest(Lists.newArrayList("dia"), before, before, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
assertPluginError(true);
|
assertPluginError(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testExtendVisualSelection() {
|
public void testExtendVisualSelection() {
|
||||||
doTest(Lists.newArrayList("vllia"), "function(int arg1, ch<caret>ar* arg2=\"a,b,c(d,e)\")",
|
doTest(Lists.newArrayList("vllia"), "function(int arg1, ch<caret>ar* arg2=\"a,b,c(d,e)\")",
|
||||||
"function(int arg1, <selection>char* arg2=\"a,b,c(d,e)\"</selection>)", VimStateMachine.Mode.VISUAL,
|
"function(int arg1, <selection>char* arg2=\"a,b,c(d,e)\"</selection>)", VimStateMachine.Mode.VISUAL,
|
||||||
@ -190,11 +209,13 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.SubMode.VISUAL_CHARACTER);
|
VimStateMachine.SubMode.VISUAL_CHARACTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testExtendVisualSelectionUsesCaretPos() {
|
public void testExtendVisualSelectionUsesCaretPos() {
|
||||||
doTest(Lists.newArrayList("vllia"), "fu<caret>n(arg)", "fun(<selection>arg</selection>)", VimStateMachine.Mode.VISUAL,
|
doTest(Lists.newArrayList("vllia"), "fu<caret>n(arg)", "fun(<selection>arg</selection>)", VimStateMachine.Mode.VISUAL,
|
||||||
VimStateMachine.SubMode.VISUAL_CHARACTER);
|
VimStateMachine.SubMode.VISUAL_CHARACTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testDeleteArrayArgument() {
|
public void testDeleteArrayArgument() {
|
||||||
setArgTextObjPairsVariable("[:],(:)");
|
setArgTextObjPairsVariable("[:],(:)");
|
||||||
doTest(Lists.newArrayList("dia"), "function(int a, String[<caret>] b)", "function(int a, <caret>)",
|
doTest(Lists.newArrayList("dia"), "function(int a, String[<caret>] b)", "function(int a, <caret>)",
|
||||||
@ -203,6 +224,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testDeleteInClass() {
|
public void testDeleteInClass() {
|
||||||
doTest(Lists.newArrayList("dia"), "class MyClass{ public int myFun() { some<caret>Call(); } }",
|
doTest(Lists.newArrayList("dia"), "class MyClass{ public int myFun() { some<caret>Call(); } }",
|
||||||
"class MyClass{ public int myFun() { some<caret>Call(); } }", VimStateMachine.Mode.COMMAND,
|
"class MyClass{ public int myFun() { some<caret>Call(); } }", VimStateMachine.Mode.COMMAND,
|
||||||
@ -212,6 +234,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testFunctionWithSpaceAfterName() {
|
public void testFunctionWithSpaceAfterName() {
|
||||||
doTest(Lists.newArrayList("dia"), "function (int <caret>a)", "function (int <caret>a)", VimStateMachine.Mode.COMMAND,
|
doTest(Lists.newArrayList("dia"), "function (int <caret>a)", "function (int <caret>a)", VimStateMachine.Mode.COMMAND,
|
||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
@ -220,6 +243,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VimBehaviorDiffers(originalVimAfter = "function (int <caret>a, int b)", description = "Should work the same as testFunctionWithSpaceAfterName")
|
@VimBehaviorDiffers(originalVimAfter = "function (int <caret>a, int b)", description = "Should work the same as testFunctionWithSpaceAfterName")
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testFunctionWithSpaceAfterNameWithTwoArgs() {
|
public void testFunctionWithSpaceAfterNameWithTwoArgs() {
|
||||||
doTest(Lists.newArrayList("dia"), "function (int <caret>a, int b)", "function (, int b)", VimStateMachine.Mode.COMMAND,
|
doTest(Lists.newArrayList("dia"), "function (int <caret>a, int b)", "function (, int b)", VimStateMachine.Mode.COMMAND,
|
||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
@ -227,6 +251,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testDeleteInIf() {
|
public void testDeleteInIf() {
|
||||||
doTest(Lists.newArrayList("dia"), "class MyClass{ public int myFun() { if (tr<caret>ue) { somFunction(); } } }",
|
doTest(Lists.newArrayList("dia"), "class MyClass{ public int myFun() { if (tr<caret>ue) { somFunction(); } } }",
|
||||||
"class MyClass{ public int myFun() { if (tr<caret>ue) { somFunction(); } } }", VimStateMachine.Mode.COMMAND,
|
"class MyClass{ public int myFun() { if (tr<caret>ue) { somFunction(); } } }", VimStateMachine.Mode.COMMAND,
|
||||||
@ -236,6 +261,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
VimStateMachine.SubMode.NONE);
|
VimStateMachine.SubMode.NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testParseVariablePairs() {
|
public void testParseVariablePairs() {
|
||||||
assertPluginError(false);
|
assertPluginError(false);
|
||||||
setArgTextObjPairsVariable("[:], (:)");
|
setArgTextObjPairsVariable("[:], (:)");
|
||||||
@ -280,6 +306,7 @@ public class VimArgTextObjExtensionTest extends VimTestCase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
public void testCppLambaArguments() {
|
public void testCppLambaArguments() {
|
||||||
setArgTextObjPairsVariable("[:],(:),{:},<:>");
|
setArgTextObjPairsVariable("[:],(:),{:},<:>");
|
||||||
doTest(Lists.newArrayList("daa"),
|
doTest(Lists.newArrayList("daa"),
|
||||||
|
@ -22,17 +22,21 @@ import com.intellij.ide.highlighter.HtmlFileType
|
|||||||
import com.intellij.ide.highlighter.JavaFileType
|
import com.intellij.ide.highlighter.JavaFileType
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
import org.jetbrains.yaml.YAMLFileType
|
import org.jetbrains.yaml.YAMLFileType
|
||||||
|
|
||||||
@Suppress("SpellCheckingInspection")
|
@Suppress("SpellCheckingInspection")
|
||||||
class CommentaryExtensionTest : VimTestCase() {
|
class CommentaryExtensionTest : VimTestCase() {
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
override fun setUp() {
|
override fun setUp() {
|
||||||
super.setUp()
|
super.setUp()
|
||||||
enableExtensions("commentary")
|
enableExtensions("commentary")
|
||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |l| + move caret
|
// |gc| |l| + move caret
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testBlockCommentSingle() {
|
fun testBlockCommentSingle() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcll",
|
"gcll",
|
||||||
@ -44,6 +48,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |iw|
|
// |gc| |iw|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testBlockCommentInnerWord() {
|
fun testBlockCommentInnerWord() {
|
||||||
doTest(
|
doTest(
|
||||||
"gciw",
|
"gciw",
|
||||||
@ -55,6 +60,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |iw|
|
// |gc| |iw|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testBlockCommentTillForward() {
|
fun testBlockCommentTillForward() {
|
||||||
doTest(
|
doTest(
|
||||||
"gct{",
|
"gct{",
|
||||||
@ -65,6 +71,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |ab|
|
// |gc| |ab|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testBlockCommentOuterParens() {
|
fun testBlockCommentOuterParens() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcab",
|
"gcab",
|
||||||
@ -79,6 +86,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
* otherwise, they are incredibly difficult to undo
|
* otherwise, they are incredibly difficult to undo
|
||||||
*/
|
*/
|
||||||
// |gc| |j|
|
// |gc| |j|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentDown() {
|
fun testLineCommentDown() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcj",
|
"gcj",
|
||||||
@ -89,6 +97,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentDownPreservesAbsoluteCaretLocation() {
|
fun testLineCommentDownPreservesAbsoluteCaretLocation() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcj",
|
"gcj",
|
||||||
@ -100,6 +109,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |ip|
|
// |gc| |ip|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentInnerParagraph() {
|
fun testLineCommentInnerParagraph() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcip",
|
"gcip",
|
||||||
@ -111,6 +121,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |ip|
|
// |gc| |ip|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentSingleLineInnerParagraph() {
|
fun testLineCommentSingleLineInnerParagraph() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcip",
|
"gcip",
|
||||||
@ -121,6 +132,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure uncommenting works as well */ // |gc| |ip|
|
/* Ensure uncommenting works as well */ // |gc| |ip|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineUncommentInnerParagraph() {
|
fun testLineUncommentInnerParagraph() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcip",
|
"gcip",
|
||||||
@ -133,6 +145,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |ip|
|
// |gc| |ip|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineUncommentSingleLineInnerParagraph() {
|
fun testLineUncommentSingleLineInnerParagraph() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcip",
|
"gcip",
|
||||||
@ -143,6 +156,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Visual mode */ // |gc| |ip|
|
/* Visual mode */ // |gc| |ip|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentVisualInnerParagraph() {
|
fun testLineCommentVisualInnerParagraph() {
|
||||||
doTest(
|
doTest(
|
||||||
"vipgc",
|
"vipgc",
|
||||||
@ -154,6 +168,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gc| |ip|
|
// |gc| |ip|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineUncommentVisualInnerParagraph() {
|
fun testLineUncommentVisualInnerParagraph() {
|
||||||
doTest(
|
doTest(
|
||||||
"vipgc",
|
"vipgc",
|
||||||
@ -165,6 +180,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Special shortcut gcc is always linewise */ // |gcc|
|
/* Special shortcut gcc is always linewise */ // |gcc|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentShortcut() {
|
fun testLineCommentShortcut() {
|
||||||
doTest(
|
doTest(
|
||||||
"gccj",
|
"gccj",
|
||||||
@ -177,6 +193,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gcc|
|
// |gcc|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineCommentShortcutSetsCaretToMotionLocation() {
|
fun testLineCommentShortcutSetsCaretToMotionLocation() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcc",
|
"gcc",
|
||||||
@ -188,6 +205,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gcc|
|
// |gcc|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testLineUncommentShortcut() {
|
fun testLineUncommentShortcut() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcc",
|
"gcc",
|
||||||
@ -200,6 +218,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |gcc|
|
// |gcc|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testHTMLCommentShortcut() {
|
fun testHTMLCommentShortcut() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcc",
|
"gcc",
|
||||||
@ -212,6 +231,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
assertSelection(null)
|
assertSelection(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test comment motion repeat`() {
|
fun `test comment motion repeat`() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcj" + "jj.",
|
"gcj" + "jj.",
|
||||||
@ -231,6 +251,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test comment motion right repeat`() {
|
fun `test comment motion right repeat`() {
|
||||||
doTest(
|
doTest(
|
||||||
"gciw" + "jj.",
|
"gciw" + "jj.",
|
||||||
@ -250,6 +271,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test comment line repeat`() {
|
fun `test comment line repeat`() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcc" + "j.",
|
"gcc" + "j.",
|
||||||
@ -266,6 +288,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VimBehaviorDiffers(description = "IntelliJ's uncomment leaves the leading whitespace")
|
@VimBehaviorDiffers(description = "IntelliJ's uncomment leaves the leading whitespace")
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test uncomment with gcgc`() {
|
fun `test uncomment with gcgc`() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcgc",
|
"gcgc",
|
||||||
@ -286,6 +309,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VimBehaviorDiffers(description = "IntelliJ's uncomment leaves the leading whitespace")
|
@VimBehaviorDiffers(description = "IntelliJ's uncomment leaves the leading whitespace")
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test uncomment with gcu`() {
|
fun `test uncomment with gcu`() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcu",
|
"gcu",
|
||||||
@ -305,6 +329,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test comment line with count`() {
|
fun `test comment line with count`() {
|
||||||
// Caret position is kept as the position *before* the commenting. This is how Vim works
|
// Caret position is kept as the position *before* the commenting. This is how Vim works
|
||||||
doTest(
|
doTest(
|
||||||
@ -329,6 +354,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment`() {
|
fun `test text object deletes single line comment`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -343,6 +369,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes multiple line comments`() {
|
fun `test text object deletes multiple line comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -361,6 +388,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes multiple line comments 2`() {
|
fun `test text object deletes multiple line comments 2`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -379,6 +407,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment from leading whitespace`() {
|
fun `test text object deletes single line comment from leading whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -393,6 +422,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment from leading whitespace 2`() {
|
fun `test text object deletes single line comment from leading whitespace 2`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -409,6 +439,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment from leading whitespace 3`() {
|
fun `test text object deletes single line comment from leading whitespace 3`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -427,6 +458,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment from trailing whitespace`() {
|
fun `test text object deletes single line comment from trailing whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -444,6 +476,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comments separated by whitespace`() {
|
fun `test text object deletes single line comments separated by whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -460,6 +493,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes disjointed single line comments from whitespace`() {
|
fun `test text object deletes disjointed single line comments from whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -481,6 +515,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
final Int value = 42;
|
final Int value = 42;
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment from current line`() {
|
fun `test text object deletes single line comment from current line`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -496,6 +531,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes single line comment from current line 2`() {
|
fun `test text object deletes single line comment from current line 2`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -512,6 +548,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object does not delete line with comment and text`() {
|
fun `test text object does not delete line with comment and text`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -525,6 +562,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes block comment`() {
|
fun `test text object deletes block comment`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -539,6 +577,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes multi-line block comment`() {
|
fun `test text object deletes multi-line block comment`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -555,6 +594,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes adjoining multi-line block comments`() {
|
fun `test text object deletes adjoining multi-line block comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -574,6 +614,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes adjoining multi-line block comments 2`() {
|
fun `test text object deletes adjoining multi-line block comments 2`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -594,6 +635,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object does not delete line with text and block comment`() {
|
fun `test text object does not delete line with text and block comment`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -607,6 +649,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes JavaDoc comment`() {
|
fun `test text object deletes JavaDoc comment`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -627,6 +670,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes JavaDoc comment from leading whitespace`() {
|
fun `test text object deletes JavaDoc comment from leading whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -648,6 +692,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes JavaDoc comment and adjoining comments`() {
|
fun `test text object deletes JavaDoc comment and adjoining comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -669,6 +714,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test text object deletes JavaDoc comment and adjoining comments separated by whitespace`() {
|
fun `test text object deletes JavaDoc comment and adjoining comments separated by whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dgc",
|
"dgc",
|
||||||
@ -693,6 +739,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test Commentary command comments current line`() {
|
fun `test Commentary command comments current line`() {
|
||||||
doTest(
|
doTest(
|
||||||
":Commentary<CR>",
|
":Commentary<CR>",
|
||||||
@ -710,6 +757,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test Commentary command comments simple line range`() {
|
fun `test Commentary command comments simple line range`() {
|
||||||
doTest(
|
doTest(
|
||||||
":2Commentary<CR>",
|
":2Commentary<CR>",
|
||||||
@ -727,6 +775,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test Commentary command comments line range`() {
|
fun `test Commentary command comments line range`() {
|
||||||
doTest(
|
doTest(
|
||||||
":1,3Commentary<CR>",
|
":1,3Commentary<CR>",
|
||||||
@ -755,6 +804,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
"Note that Escape exits Visual mode, but leaves the caret where it is",
|
"Note that Escape exits Visual mode, but leaves the caret where it is",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test Commentary command comments visual range`() {
|
fun `test Commentary command comments visual range`() {
|
||||||
doTest(
|
doTest(
|
||||||
"Vjj" + ":Commentary<CR>",
|
"Vjj" + ":Commentary<CR>",
|
||||||
@ -772,6 +822,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test Commentary command comments search range`() {
|
fun `test Commentary command comments search range`() {
|
||||||
doTest(
|
doTest(
|
||||||
":g/value2/Commentary<CR>",
|
":g/value2/Commentary<CR>",
|
||||||
@ -793,6 +844,7 @@ class CommentaryExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test block comment falls back to line comment when not available`() {
|
fun `test block comment falls back to line comment when not available`() {
|
||||||
doTest(
|
doTest(
|
||||||
"gcw",
|
"gcw",
|
||||||
|
@ -23,6 +23,8 @@ import com.maddyhome.idea.vim.api.injector
|
|||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension
|
import com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class VimExchangeExtensionTest : VimTestCase() {
|
class VimExchangeExtensionTest : VimTestCase() {
|
||||||
@ -33,6 +35,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words left to right`() {
|
fun `test exchange words left to right`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxe", "w", "cxe"),
|
listOf("cxe", "w", "cxe"),
|
||||||
@ -44,6 +47,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words dot repeat`() {
|
fun `test exchange words dot repeat`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxiw", "w", "."),
|
listOf("cxiw", "w", "."),
|
||||||
@ -55,6 +59,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words right to left`() {
|
fun `test exchange words right to left`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxe", "b", "cxe"),
|
listOf("cxe", "b", "cxe"),
|
||||||
@ -66,6 +71,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words right to left with dot`() {
|
fun `test exchange words right to left with dot`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxe", "b", "."),
|
listOf("cxe", "b", "."),
|
||||||
@ -77,6 +83,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// |X|
|
// |X|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual exchange words left to right`() {
|
fun `test visual exchange words left to right`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("veX", "w", "veX"),
|
listOf("veX", "w", "veX"),
|
||||||
@ -92,6 +99,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
originalVimAfter = "The ${c}brown catch over the lazy dog",
|
originalVimAfter = "The ${c}brown catch over the lazy dog",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual exchange words from inside`() {
|
fun `test visual exchange words from inside`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("veX", "b", "v3e", "X"),
|
listOf("veX", "b", "v3e", "X"),
|
||||||
@ -107,6 +115,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
originalVimAfter = "The brown ${c}catch over the lazy dog",
|
originalVimAfter = "The brown ${c}catch over the lazy dog",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual exchange words from outside`() {
|
fun `test visual exchange words from outside`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("v3e", "X", "w", "veX"),
|
listOf("v3e", "X", "w", "veX"),
|
||||||
@ -127,6 +136,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
""",
|
""",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange lines top down`() {
|
fun `test exchange lines top down`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxx", "j", "cxx"),
|
listOf("cxx", "j", "cxx"),
|
||||||
@ -155,6 +165,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
""",
|
""",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange lines top down with dot`() {
|
fun `test exchange lines top down with dot`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxx", "j", "."),
|
listOf("cxx", "j", "."),
|
||||||
@ -181,6 +192,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
lazy dog
|
lazy dog
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange to the line end`() {
|
fun `test exchange to the line end`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("v$", "X", "jj^ve", "X"),
|
listOf("v$", "X", "jj^ve", "X"),
|
||||||
@ -209,6 +221,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
""",
|
""",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange visual lines`() {
|
fun `test exchange visual lines`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("Vj", "X", "jj", "Vj", "X"),
|
listOf("Vj", "X", "jj", "Vj", "X"),
|
||||||
@ -230,6 +243,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual char highlighter`() {
|
fun `test visual char highlighter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
@ -246,6 +260,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual line highdhitligthhter`() {
|
fun `test visual line highdhitligthhter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
@ -262,6 +277,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test till the line end highlighter`() {
|
fun `test till the line end highlighter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
@ -276,6 +292,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test pre line end highlighter`() {
|
fun `test pre line end highlighter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
@ -290,6 +307,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test pre pre line end highlighter`() {
|
fun `test pre pre line end highlighter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
@ -304,6 +322,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test to file end highlighter`() {
|
fun `test to file end highlighter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The quick
|
The quick
|
||||||
@ -325,6 +344,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test to file end with new line highlighter`() {
|
fun `test to file end with new line highlighter`() {
|
||||||
val before = """
|
val before = """
|
||||||
The quick
|
The quick
|
||||||
@ -347,6 +367,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test back selection`() {
|
fun `test back selection`() {
|
||||||
val before = """
|
val before = """
|
||||||
The quick
|
The quick
|
||||||
@ -362,6 +383,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test back selection exchange 1`() {
|
fun `test back selection exchange 1`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("vb", "X", "bevb", "X"),
|
listOf("vb", "X", "bevb", "X"),
|
||||||
@ -372,6 +394,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test back selection exchange 2`() {
|
fun `test back selection exchange 2`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("vb", "X", "wve", "X"),
|
listOf("vb", "X", "wve", "X"),
|
||||||
@ -382,6 +405,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test back selection exchange 3`() {
|
fun `test back selection exchange 3`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("ve", "X", "wevb", "X"),
|
listOf("ve", "X", "wevb", "X"),
|
||||||
@ -392,6 +416,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test change with down motion`() {
|
fun `test change with down motion`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
@ -411,6 +436,7 @@ class VimExchangeExtensionTest : VimTestCase() {
|
|||||||
exitExchange()
|
exitExchange()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test cxx`() {
|
fun `test cxx`() {
|
||||||
val before = """
|
val before = """
|
||||||
The ${c}quick
|
The ${c}quick
|
||||||
|
@ -25,6 +25,8 @@ import com.maddyhome.idea.vim.extension.exchange.VimExchangeExtension
|
|||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
import com.maddyhome.idea.vim.options.OptionConstants
|
import com.maddyhome.idea.vim.options.OptionConstants
|
||||||
import org.jetbrains.plugins.ideavim.OptionValueType
|
import org.jetbrains.plugins.ideavim.OptionValueType
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
import org.jetbrains.plugins.ideavim.VimOptionTestCase
|
||||||
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
import org.jetbrains.plugins.ideavim.VimOptionTestConfiguration
|
||||||
import org.jetbrains.plugins.ideavim.VimTestOption
|
import org.jetbrains.plugins.ideavim.VimTestOption
|
||||||
@ -38,6 +40,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words left to right`() {
|
fun `test exchange words left to right`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxe", "w", "cxe"),
|
listOf("cxe", "w", "cxe"),
|
||||||
@ -50,6 +53,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words dot repeat`() {
|
fun `test exchange words dot repeat`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxiw", "w", "."),
|
listOf("cxiw", "w", "."),
|
||||||
@ -62,6 +66,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words right to left`() {
|
fun `test exchange words right to left`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxe", "b", "cxe"),
|
listOf("cxe", "b", "cxe"),
|
||||||
@ -74,6 +79,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
|
|
||||||
// |cx|
|
// |cx|
|
||||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange words right to left with dot`() {
|
fun `test exchange words right to left with dot`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxe", "b", "."),
|
listOf("cxe", "b", "."),
|
||||||
@ -86,6 +92,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
|
|
||||||
// |X|
|
// |X|
|
||||||
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
@VimOptionTestConfiguration(VimTestOption(OptionConstants.clipboardName, OptionValueType.STRING, "unnamed"))
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual exchange words left to right`() {
|
fun `test visual exchange words left to right`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("veX", "w", "veX"),
|
listOf("veX", "w", "veX"),
|
||||||
@ -102,6 +109,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
originalVimAfter = "The ${c}brown catch over the lazy dog",
|
originalVimAfter = "The ${c}brown catch over the lazy dog",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual exchange words from inside`() {
|
fun `test visual exchange words from inside`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("veX", "b", "v3e", "X"),
|
listOf("veX", "b", "v3e", "X"),
|
||||||
@ -118,6 +126,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
originalVimAfter = "The brown ${c}catch over the lazy dog",
|
originalVimAfter = "The brown ${c}catch over the lazy dog",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual exchange words from outside`() {
|
fun `test visual exchange words from outside`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("v3e", "X", "w", "veX"),
|
listOf("v3e", "X", "w", "veX"),
|
||||||
@ -139,6 +148,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
""",
|
""",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange lines top down`() {
|
fun `test exchange lines top down`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxx", "j", "cxx"),
|
listOf("cxx", "j", "cxx"),
|
||||||
@ -168,6 +178,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
""",
|
""",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange lines top down with dot`() {
|
fun `test exchange lines top down with dot`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("cxx", "j", "."),
|
listOf("cxx", "j", "."),
|
||||||
@ -195,6 +206,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
lazy dog
|
lazy dog
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange to the line end`() {
|
fun `test exchange to the line end`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("v$", "X", "jj^ve", "X"),
|
listOf("v$", "X", "jj^ve", "X"),
|
||||||
@ -224,6 +236,7 @@ class VimExchangeWithClipboardTest : VimOptionTestCase(OptionConstants.clipboard
|
|||||||
""",
|
""",
|
||||||
shouldBeFixed = true
|
shouldBeFixed = true
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test exchange visual lines`() {
|
fun `test exchange visual lines`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("Vj", "X", "jj", "Vj", "X"),
|
listOf("Vj", "X", "jj", "Vj", "X"),
|
||||||
|
@ -23,6 +23,8 @@ import com.maddyhome.idea.vim.VimPlugin
|
|||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.extension.highlightedyank.DEFAULT_HIGHLIGHT_DURATION
|
import com.maddyhome.idea.vim.extension.highlightedyank.DEFAULT_HIGHLIGHT_DURATION
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
import org.jetbrains.plugins.ideavim.assertHappened
|
import org.jetbrains.plugins.ideavim.assertHappened
|
||||||
|
|
||||||
@ -32,6 +34,7 @@ class VimHighlightedYankTest : VimTestCase() {
|
|||||||
enableExtensions("highlightedyank")
|
enableExtensions("highlightedyank")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test highlighting whole line when whole line is yanked`() {
|
fun `test highlighting whole line when whole line is yanked`() {
|
||||||
doTest("yy", code, code, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yy", code, code, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
|
|
||||||
@ -39,6 +42,7 @@ class VimHighlightedYankTest : VimTestCase() {
|
|||||||
assertHighlighterRange(1, 40, getFirstHighlighter())
|
assertHighlighterRange(1, 40, getFirstHighlighter())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test highlighting single word when single word is yanked`() {
|
fun `test highlighting single word when single word is yanked`() {
|
||||||
doTest("yiw", code, code, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yiw", code, code, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
|
|
||||||
@ -54,6 +58,7 @@ class VimHighlightedYankTest : VimTestCase() {
|
|||||||
assertHighlighterRange(40, 59, getFirstHighlighter())
|
assertHighlighterRange(40, 59, getFirstHighlighter())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test removing previous highlight when entering insert mode`() {
|
fun `test removing previous highlight when entering insert mode`() {
|
||||||
doTest("yyi", code, code, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
doTest("yyi", code, code, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
||||||
|
|
||||||
@ -105,6 +110,7 @@ class VimHighlightedYankTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test highlighting with multiple cursors`() {
|
fun `test highlighting with multiple cursors`() {
|
||||||
doTest("yiw", codeWithMultipleCurors, codeWithMultipleCurors, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yiw", codeWithMultipleCurors, codeWithMultipleCurors, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
|
|
||||||
@ -115,12 +121,14 @@ class VimHighlightedYankTest : VimTestCase() {
|
|||||||
assertHighlighterRange(28, 31, highlighters[2])
|
assertHighlighterRange(28, 31, highlighters[2])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test clearing all highlighters with multiple cursors`() {
|
fun `test clearing all highlighters with multiple cursors`() {
|
||||||
doTest("yiwi", codeWithMultipleCurors, codeWithMultipleCurors, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
doTest("yiwi", codeWithMultipleCurors, codeWithMultipleCurors, VimStateMachine.Mode.INSERT, VimStateMachine.SubMode.NONE)
|
||||||
|
|
||||||
assertAllHighlightersCount(0)
|
assertAllHighlightersCount(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test highlighting for a correct default amount of time`() {
|
fun `test highlighting for a correct default amount of time`() {
|
||||||
doTest("yiw", code, code, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yiw", code, code, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
|
|
||||||
@ -129,6 +137,7 @@ class VimHighlightedYankTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test highlighting for a correct user provided amount of time`() {
|
fun `test highlighting for a correct user provided amount of time`() {
|
||||||
configureByJavaText(code)
|
configureByJavaText(code)
|
||||||
typeText(injector.parser.parseKeys(":let g:highlightedyank_highlight_duration = \"1000\"<CR>"))
|
typeText(injector.parser.parseKeys(":let g:highlightedyank_highlight_duration = \"1000\"<CR>"))
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.plugins.ideavim.extension.matchit
|
package org.jetbrains.plugins.ideavim.extension.matchit
|
||||||
|
|
||||||
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class MatchitCMakeTest : VimTestCase() {
|
class MatchitCMakeTest : VimTestCase() {
|
||||||
@ -27,6 +30,7 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
enableExtensions("matchit")
|
enableExtensions("matchit")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from if to else`() {
|
fun `test jump from if to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -44,10 +48,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Non-linux system")
|
message("Non-linux system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from else to endif`() {
|
fun `test jump from else to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -65,10 +70,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Non-linux system")
|
message("Non-linux system")
|
||||||
${c}endif()
|
${c}endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to if`() {
|
fun `test jump from endif to if`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -86,10 +92,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Non-linux system")
|
message("Non-linux system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from if to elseif in if-else structure`() {
|
fun `test jump from if to elseif in if-else structure`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -115,10 +122,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from elseif to elseif`() {
|
fun `test jump from elseif to elseif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -144,10 +152,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from elseif to else`() {
|
fun `test jump from elseif to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -173,10 +182,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from else to endif in if-else structure`() {
|
fun `test jump from else to endif in if-else structure`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -202,10 +212,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
${c}endif()
|
${c}endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to if in if-else structure`() {
|
fun `test jump from endif to if in if-else structure`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -231,10 +242,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from foreach to endforeach`() {
|
fun `test jump from foreach to endforeach`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -248,10 +260,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
${c}endforeach()
|
${c}endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endforeach to foreach`() {
|
fun `test jump from endforeach to foreach`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -265,10 +278,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
endforeach()
|
endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from foreach to break`() {
|
fun `test jump from foreach to break`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -288,10 +302,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
endforeach()
|
endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from break to endforeach`() {
|
fun `test jump from break to endforeach`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -311,10 +326,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
${c}endforeach()
|
${c}endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from while to endwhile`() {
|
fun `test jump from while to endwhile`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -328,10 +344,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
MATH(EXPR VAR "${"\${index}"}+1")
|
MATH(EXPR VAR "${"\${index}"}+1")
|
||||||
${c}endwhile()
|
${c}endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endwhile to while`() {
|
fun `test jump from endwhile to while`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -345,10 +362,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
MATH(EXPR VAR "${"\${index}"}+1")
|
MATH(EXPR VAR "${"\${index}"}+1")
|
||||||
endwhile()
|
endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from while to break`() {
|
fun `test jump from while to break`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -368,10 +386,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
endif()
|
endif()
|
||||||
endwhile()
|
endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from break to endwhile`() {
|
fun `test jump from break to endwhile`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -391,10 +410,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
endif()
|
endif()
|
||||||
${c}endwhile()
|
${c}endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from function to endfunction`() {
|
fun `test jump from function to endfunction`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -408,10 +428,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
bar(x y z)
|
bar(x y z)
|
||||||
${c}endfunction()
|
${c}endfunction()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endfunction to function`() {
|
fun `test jump from endfunction to function`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -425,10 +446,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
bar(x y z)
|
bar(x y z)
|
||||||
endfunction()
|
endfunction()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from macro to endmacro`() {
|
fun `test jump from macro to endmacro`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -442,10 +464,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("arg = ${"\${arg}\""}")
|
message("arg = ${"\${arg}\""}")
|
||||||
${c}endmacro()
|
${c}endmacro()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endmacro to macro`() {
|
fun `test jump from endmacro to macro`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -459,12 +482,13 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("arg = ${"\${arg}\""}")
|
message("arg = ${"\${arg}\""}")
|
||||||
endmacro()
|
endmacro()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tests for reverse motion
|
// Tests for reverse motion
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from if to endif`() {
|
fun `test reverse jump from if to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -482,10 +506,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Non-linux system")
|
message("Non-linux system")
|
||||||
${c}endif()
|
${c}endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from else to if`() {
|
fun `test reverse jump from else to if`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -503,10 +528,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Non-linux system")
|
message("Non-linux system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to else`() {
|
fun `test reverse jump from endif to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -524,10 +550,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Non-linux system")
|
message("Non-linux system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from if to endif in if-else block`() {
|
fun `test reverse jump from if to endif in if-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -553,10 +580,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
${c}endif()
|
${c}endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from elseif to if`() {
|
fun `test reverse jump from elseif to if`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -582,10 +610,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from elseif in else block to elseif`() {
|
fun `test reverse jump from elseif in else block to elseif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -611,10 +640,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from else to elseif`() {
|
fun `test reverse jump from else to elseif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -640,10 +670,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to else in if-else block`() {
|
fun `test reverse jump from endif to else in if-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -669,10 +700,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("Unknown system")
|
message("Unknown system")
|
||||||
endif()
|
endif()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from foreach to endforeach`() {
|
fun `test reverse jump from foreach to endforeach`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -686,10 +718,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
${c}endforeach()
|
${c}endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endforeach to foreach`() {
|
fun `test reverse jump from endforeach to foreach`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -703,10 +736,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
endforeach()
|
endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from foreach to endforeach over a break`() {
|
fun `test reverse jump from foreach to endforeach over a break`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -726,10 +760,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
${c}endforeach()
|
${c}endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endforeach to break`() {
|
fun `test reverse jump from endforeach to break`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -749,10 +784,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
endforeach()
|
endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from break to foreach`() {
|
fun `test reverse jump from break to foreach`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -772,10 +808,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message(STATUS "X=${"\${X}"}")
|
message(STATUS "X=${"\${X}"}")
|
||||||
endforeach()
|
endforeach()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from while to endwhile`() {
|
fun `test reverse jump from while to endwhile`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -789,10 +826,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
MATH(EXPR VAR "${"\${index}"}+1")
|
MATH(EXPR VAR "${"\${index}"}+1")
|
||||||
${c}endwhile()
|
${c}endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endwhile to while`() {
|
fun `test reverse jump from endwhile to while`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -806,10 +844,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
MATH(EXPR VAR "${"\${index}"}+1")
|
MATH(EXPR VAR "${"\${index}"}+1")
|
||||||
endwhile()
|
endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from while to endwhile over a break`() {
|
fun `test reverse jump from while to endwhile over a break`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -829,10 +868,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
endif()
|
endif()
|
||||||
${c}endwhile()
|
${c}endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endwhile to break`() {
|
fun `test reverse jump from endwhile to break`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -852,10 +892,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
endif()
|
endif()
|
||||||
endwhile()
|
endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from break to while`() {
|
fun `test reverse jump from break to while`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -875,10 +916,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
endif()
|
endif()
|
||||||
endwhile()
|
endwhile()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from function to endfunction`() {
|
fun `test reverse jump from function to endfunction`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -892,10 +934,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
bar(x y z)
|
bar(x y z)
|
||||||
${c}endfunction()
|
${c}endfunction()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endfunction to function`() {
|
fun `test reverse jump from endfunction to function`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -909,10 +952,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
bar(x y z)
|
bar(x y z)
|
||||||
endfunction()
|
endfunction()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from macro to endmacro`() {
|
fun `test reverse jump from macro to endmacro`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -926,10 +970,11 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("arg = ${"\${arg}\""}")
|
message("arg = ${"\${arg}\""}")
|
||||||
${c}endmacro()
|
${c}endmacro()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endmacro to macro`() {
|
fun `test reverse jump from endmacro to macro`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -943,7 +988,7 @@ class MatchitCMakeTest : VimTestCase() {
|
|||||||
message("arg = ${"\${arg}\""}")
|
message("arg = ${"\${arg}\""}")
|
||||||
endmacro()
|
endmacro()
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "CMakeLists.txt"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "CMakeLists.txt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.plugins.ideavim.extension.matchit
|
package org.jetbrains.plugins.ideavim.extension.matchit
|
||||||
|
|
||||||
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class MatchitCTest : VimTestCase() {
|
class MatchitCTest : VimTestCase() {
|
||||||
@ -27,6 +30,7 @@ class MatchitCTest : VimTestCase() {
|
|||||||
enableExtensions("matchit")
|
enableExtensions("matchit")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #if to #endif`() {
|
fun `test jump from #if to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -38,10 +42,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#if !defined (VAL_1)
|
#if !defined (VAL_1)
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from whitespace before #if to #endif`() {
|
fun `test jump from whitespace before #if to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -53,10 +58,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#if !defined (VAL_1)
|
#if !defined (VAL_1)
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #if to #elif`() {
|
fun `test jump from #if to #elif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -72,10 +78,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#elif !defined (VAL_2)
|
$c#elif !defined (VAL_2)
|
||||||
#define VAL_2 2
|
#define VAL_2 2
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #if to #else`() {
|
fun `test jump from #if to #else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -91,10 +98,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#else
|
$c#else
|
||||||
#define VAL_2 2
|
#define VAL_2 2
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #elif to #else`() {
|
fun `test jump from #elif to #else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -106,10 +114,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#elif !defined (VAL_2)
|
#elif !defined (VAL_2)
|
||||||
$c#else
|
$c#else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from whitespace before #elif to #else`() {
|
fun `test jump from whitespace before #elif to #else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -121,10 +130,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#elif !defined (VAL_2)
|
#elif !defined (VAL_2)
|
||||||
$c#else
|
$c#else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #else to #endif`() {
|
fun `test jump from #else to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -136,10 +146,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#else
|
#else
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from whitespace before #else to #endif`() {
|
fun `test jump from whitespace before #else to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -151,10 +162,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#else !defined (VAL_2)
|
#else !defined (VAL_2)
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #endif to #if`() {
|
fun `test jump from #endif to #if`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -176,10 +188,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#define VAL_3 3
|
#define VAL_3 3
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #ifdef to #endif`() {
|
fun `test jump from #ifdef to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -191,10 +204,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #ifdef to #elif`() {
|
fun `test jump from #ifdef to #elif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -206,10 +220,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
$c#elif PROD
|
$c#elif PROD
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #ifdef to #else`() {
|
fun `test jump from #ifdef to #else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -221,10 +236,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
$c#else
|
$c#else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #endif to #ifdef`() {
|
fun `test jump from #endif to #ifdef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -236,10 +252,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifdef DEBUG
|
$c#ifdef DEBUG
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #ifndef to #endif`() {
|
fun `test jump from #ifndef to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -251,10 +268,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #ifndef to #elif`() {
|
fun `test jump from #ifndef to #elif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -266,10 +284,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
$c#elif PROD
|
$c#elif PROD
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #ifndef to #else`() {
|
fun `test jump from #ifndef to #else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -281,10 +300,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
$c#else
|
$c#else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #endif to #ifndef`() {
|
fun `test jump from #endif to #ifndef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -296,10 +316,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifndef DEBUG
|
$c#ifndef DEBUG
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't jump from malformed #if`() {
|
fun `test don't jump from malformed #if`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -311,10 +332,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifff DEBUG
|
$c#ifff DEBUG
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from #if with whitespace to #endif`() {
|
fun `test jump from #if with whitespace to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -326,10 +348,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
# if DEBUG
|
# if DEBUG
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from nested #if to #endif`() {
|
fun `test jump from nested #if to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -345,7 +368,7 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c# endif
|
$c# endif
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,6 +376,7 @@ class MatchitCTest : VimTestCase() {
|
|||||||
* Tests for reverse g% motion
|
* Tests for reverse g% motion
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #if to #endif`() {
|
fun `test reverse jump from #if to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -364,10 +388,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#if !defined (VAL_1)
|
#if !defined (VAL_1)
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from whitespace before #if to #endif`() {
|
fun `test reverse jump from whitespace before #if to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -379,10 +404,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#if !defined (VAL_1)
|
#if !defined (VAL_1)
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #endif to #if with whitespace`() {
|
fun `test reverse jump from #endif to #if with whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -394,10 +420,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c# if DEBUG
|
$c# if DEBUG
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #endif to #else`() {
|
fun `test reverse jump from #endif to #else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -411,10 +438,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#define VAL_3 3
|
#define VAL_3 3
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #else to #elif`() {
|
fun `test reverse jump from #else to #elif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -432,10 +460,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#define VAL_3 3
|
#define VAL_3 3
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from whitespace before #else to #elif`() {
|
fun `test reverse jump from whitespace before #else to #elif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -453,10 +482,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#define VAL_3 3
|
#define VAL_3 3
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #elif to #if`() {
|
fun `test reverse jump from #elif to #if`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -472,10 +502,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#elif !defined (VAL_2)
|
#elif !defined (VAL_2)
|
||||||
#define VAL_2 2
|
#define VAL_2 2
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #ifdef to #endif`() {
|
fun `test reverse jump from #ifdef to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -487,10 +518,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #endif to #ifdef`() {
|
fun `test reverse jump from #endif to #ifdef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -502,10 +534,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifdef DEBUG
|
$c#ifdef DEBUG
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #else to #ifdef`() {
|
fun `test reverse jump from #else to #ifdef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -517,10 +550,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifdef DEBUG
|
$c#ifdef DEBUG
|
||||||
#else
|
#else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #elif to #ifdef`() {
|
fun `test reverse jump from #elif to #ifdef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -532,10 +566,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifdef DEBUG
|
$c#ifdef DEBUG
|
||||||
#elif PROD
|
#elif PROD
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #ifndef to #endif`() {
|
fun `test reverse jump from #ifndef to #endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -547,10 +582,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
$c#endif
|
$c#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #endif to #ifndef`() {
|
fun `test reverse jump from #endif to #ifndef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -562,10 +598,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifndef DEBUG
|
$c#ifndef DEBUG
|
||||||
#endif
|
#endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #elif to #ifndef`() {
|
fun `test reverse jump from #elif to #ifndef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -577,10 +614,11 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifndef DEBUG
|
$c#ifndef DEBUG
|
||||||
#elif PROD
|
#elif PROD
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from #else to #ifndef`() {
|
fun `test reverse jump from #else to #ifndef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -592,7 +630,7 @@ class MatchitCTest : VimTestCase() {
|
|||||||
$c#ifndef DEBUG
|
$c#ifndef DEBUG
|
||||||
#else
|
#else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "main.c"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "main.c"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.plugins.ideavim.extension.matchit
|
package org.jetbrains.plugins.ideavim.extension.matchit
|
||||||
|
|
||||||
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class MatchitGNUMakeTest : VimTestCase() {
|
class MatchitGNUMakeTest : VimTestCase() {
|
||||||
@ -27,6 +30,7 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
enableExtensions("matchit")
|
enableExtensions("matchit")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from define to endef`() {
|
fun `test jump from define to endef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -42,10 +46,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
second line
|
second line
|
||||||
${c}endef
|
${c}endef
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endef to define`() {
|
fun `test jump from endef to define`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -61,10 +66,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
second line
|
second line
|
||||||
endef
|
endef
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifdef to endif`() {
|
fun `test jump from ifdef to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -78,10 +84,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info defined)
|
$(info defined)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to ifdef`() {
|
fun `test jump from endif to ifdef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -95,10 +102,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info defined)
|
$(info defined)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifndef to endif`() {
|
fun `test jump from ifndef to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -112,10 +120,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not defined)
|
$(info not defined)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to ifndef`() {
|
fun `test jump from endif to ifndef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -129,10 +138,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not defined)
|
$(info not defined)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifeq to endif`() {
|
fun `test jump from ifeq to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -146,10 +156,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info empty)
|
$(info empty)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to ifeq`() {
|
fun `test jump from endif to ifeq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -163,10 +174,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info empty)
|
$(info empty)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifneq to endif`() {
|
fun `test jump from ifneq to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -180,10 +192,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not empty)
|
$(info not empty)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to ifneq`() {
|
fun `test jump from endif to ifneq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -197,10 +210,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not empty)
|
$(info not empty)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifneq to else`() {
|
fun `test jump from ifneq to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -214,10 +228,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not empty)
|
$(info not empty)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifeq to else in ifeq-else block`() {
|
fun `test jump from ifeq to else in ifeq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -239,10 +254,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from else ifeq to else`() {
|
fun `test jump from else ifeq to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -264,10 +280,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifeq in else block to else`() {
|
fun `test jump from ifeq in else block to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -289,10 +306,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from else to endif in ifeq-else block`() {
|
fun `test jump from else to endif in ifeq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -314,10 +332,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to ifeq in ifeq-else block`() {
|
fun `test jump from endif to ifeq in ifeq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -339,10 +358,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifneq to else in ifneq-else block`() {
|
fun `test jump from ifneq to else in ifneq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -364,10 +384,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from else ifneq to else`() {
|
fun `test jump from else ifneq to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -389,10 +410,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from ifneq in else block to else`() {
|
fun `test jump from ifneq in else block to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -414,10 +436,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from else to endif in ifneq-else block`() {
|
fun `test jump from else to endif in ifneq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -439,10 +462,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from endif to ifneq in ifneq-else block`() {
|
fun `test jump from endif to ifneq in ifneq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -464,12 +488,13 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse tests
|
// Reverse tests
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from define to endef`() {
|
fun `test reverse jump from define to endef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -485,10 +510,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
second line
|
second line
|
||||||
${c}endef
|
${c}endef
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endef to define`() {
|
fun `test reverse jump from endef to define`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -504,10 +530,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
second line
|
second line
|
||||||
endef
|
endef
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifdef to endif`() {
|
fun `test reverse jump from ifdef to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -521,10 +548,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info defined)
|
$(info defined)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to ifdef`() {
|
fun `test reverse jump from endif to ifdef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -538,10 +566,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info defined)
|
$(info defined)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifndef to endif`() {
|
fun `test reverse jump from ifndef to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -555,10 +584,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not defined)
|
$(info not defined)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to ifndef`() {
|
fun `test reverse jump from endif to ifndef`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -572,10 +602,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not defined)
|
$(info not defined)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifeq to endif`() {
|
fun `test reverse jump from ifeq to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -589,10 +620,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info empty)
|
$(info empty)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to ifeq`() {
|
fun `test reverse jump from endif to ifeq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -606,10 +638,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info empty)
|
$(info empty)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifneq to endif`() {
|
fun `test reverse jump from ifneq to endif`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -623,10 +656,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not empty)
|
$(info not empty)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to ifneq`() {
|
fun `test reverse jump from endif to ifneq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -640,10 +674,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not empty)
|
$(info not empty)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifneq to else`() {
|
fun `test reverse jump from ifneq to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -657,10 +692,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not empty)
|
$(info not empty)
|
||||||
else
|
else
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifeq to endif in ifeq-else block`() {
|
fun `test reverse jump from ifeq to endif in ifeq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -682,10 +718,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from else ifeq to ifeq`() {
|
fun `test reverse jump from else ifeq to ifeq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -707,10 +744,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifeq in else block to ifeq`() {
|
fun `test reverse jump from ifeq in else block to ifeq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -732,10 +770,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from else to else in ifeq-else block`() {
|
fun `test reverse jump from else to else in ifeq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -757,10 +796,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to else in ifeq-else block`() {
|
fun `test reverse jump from endif to else in ifeq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -782,10 +822,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info not x86 based)
|
$(info not x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifneq to endif in ifneq-else block`() {
|
fun `test reverse jump from ifneq to endif in ifneq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -807,10 +848,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
${c}endif
|
${c}endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from else ifneq to ifneq`() {
|
fun `test reverse jump from else ifneq to ifneq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -832,10 +874,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from ifneq in else block to ifneq`() {
|
fun `test reverse jump from ifneq in else block to ifneq`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -857,10 +900,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from else to else in ifneq-else block`() {
|
fun `test reverse jump from else to else in ifneq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -882,10 +926,11 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from endif to else in ifneq-else block`() {
|
fun `test reverse jump from endif to else in ifneq-else block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -907,7 +952,7 @@ class MatchitGNUMakeTest : VimTestCase() {
|
|||||||
$(info x86 based)
|
$(info x86 based)
|
||||||
endif
|
endif
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "Makefile"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "Makefile"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ import com.intellij.ide.highlighter.JavaFileType
|
|||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
import com.maddyhome.idea.vim.helper.experimentalApi
|
import com.maddyhome.idea.vim.helper.experimentalApi
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class MatchitGeneralTest : VimTestCase() {
|
class MatchitGeneralTest : VimTestCase() {
|
||||||
@ -36,6 +38,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
* Tests to make sure we didn't break the default % motion
|
* Tests to make sure we didn't break the default % motion
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from Java comment start to end`() {
|
fun `test jump from Java comment start to end`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -49,10 +52,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
*
|
*
|
||||||
*$c/
|
*$c/
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileType = JavaFileType.INSTANCE
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, JavaFileType.INSTANCE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from Java comment end to start`() {
|
fun `test jump from Java comment end to start`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -66,10 +70,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileType = JavaFileType.INSTANCE
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, JavaFileType.INSTANCE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test 25 percent jump`() {
|
fun `test 25 percent jump`() {
|
||||||
doTest(
|
doTest(
|
||||||
"25%",
|
"25%",
|
||||||
@ -85,10 +90,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
int c;
|
int c;
|
||||||
int d;
|
int d;
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileType = HtmlFileType.INSTANCE
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, HtmlFileType.INSTANCE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from visual end of line to opening parenthesis`() {
|
fun `test jump from visual end of line to opening parenthesis`() {
|
||||||
doTest(
|
doTest(
|
||||||
"v$%",
|
"v$%",
|
||||||
@ -98,6 +104,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from visual end of line to opening parenthesis then back to closing`() {
|
fun `test jump from visual end of line to opening parenthesis then back to closing`() {
|
||||||
doTest(
|
doTest(
|
||||||
"v$%%",
|
"v$%%",
|
||||||
@ -107,13 +114,15 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete everything from opening parenthesis to closing parenthesis`() {
|
fun `test delete everything from opening parenthesis to closing parenthesis`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
"$c(x == 123)", "", fileType = HtmlFileType.INSTANCE
|
"$c(x == 123)", "", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, HtmlFileType.INSTANCE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete everything from closing parenthesis to opening parenthesis`() {
|
fun `test delete everything from closing parenthesis to opening parenthesis`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -121,6 +130,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete everything from opening curly brace to closing curly brace`() {
|
fun `test delete everything from opening curly brace to closing curly brace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -128,6 +138,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete everything from closing curly brace to opening curly brace`() {
|
fun `test delete everything from closing curly brace to opening curly brace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -135,6 +146,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete everything from opening square bracket to closing square bracket`() {
|
fun `test delete everything from opening square bracket to closing square bracket`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -142,6 +154,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete everything from closing square bracket to opening square bracket`() {
|
fun `test delete everything from closing square bracket to opening square bracket`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -152,6 +165,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
/*
|
/*
|
||||||
* Tests for visual mode and deleting on the new Matchit patterns.
|
* Tests for visual mode and deleting on the new Matchit patterns.
|
||||||
*/
|
*/
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from visual end of line to opening angle bracket`() {
|
fun `test jump from visual end of line to opening angle bracket`() {
|
||||||
doTest(
|
doTest(
|
||||||
"v$%",
|
"v$%",
|
||||||
@ -161,6 +175,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from visual end of line to start of for loop`() {
|
fun `test jump from visual end of line to start of for loop`() {
|
||||||
doTest(
|
doTest(
|
||||||
"v$%",
|
"v$%",
|
||||||
@ -174,7 +189,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts n
|
puts n
|
||||||
en${se}d
|
en${se}d
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER, fileName = "ruby.rb"
|
VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER, "ruby.rb"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,6 +203,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
""",
|
""",
|
||||||
description = "Our code changes the motion type to linewise, but it should not"
|
description = "Our code changes the motion type to linewise, but it should not"
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete from elseif to else`() {
|
fun `test delete from elseif to else`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -216,10 +232,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
end
|
end
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
},
|
},
|
||||||
fileName = "ruby.rb"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete from elseif to else 2`() {
|
fun `test delete from elseif to else 2`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -239,10 +256,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts "Positive"
|
puts "Positive"
|
||||||
end
|
end
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "ruby.rb"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete from else to elsif with reverse motion`() {
|
fun `test delete from else to elsif with reverse motion`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dg%",
|
"dg%",
|
||||||
@ -262,10 +280,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts "Positive"
|
puts "Positive"
|
||||||
end
|
end
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
fileName = "ruby.rb"
|
VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete from opening to closing div`() {
|
fun `test delete from opening to closing div`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -274,22 +293,22 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
<img src="fff">
|
<img src="fff">
|
||||||
</div>
|
</div>
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
"$c<",
|
"$c<", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, HtmlFileType.INSTANCE
|
||||||
fileType = HtmlFileType.INSTANCE
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete from opening angle bracket to closing angle bracket`() {
|
fun `test delete from opening angle bracket to closing angle bracket`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
"""
|
"""
|
||||||
$c<div></div>
|
$c<div></div>
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
"$c</div>",
|
"$c</div>", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, HtmlFileType.INSTANCE
|
||||||
fileType = HtmlFileType.INSTANCE
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete whole function from def`() {
|
fun `test delete whole function from def`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -298,11 +317,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts "hello"
|
puts "hello"
|
||||||
end
|
end
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
"",
|
"", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
fileName = "ruby.rb"
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete whole function from def with reverse motion`() {
|
fun `test delete whole function from def with reverse motion`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dg%",
|
"dg%",
|
||||||
@ -311,11 +330,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts "hello"
|
puts "hello"
|
||||||
end
|
end
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
"",
|
"", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
fileName = "ruby.rb"
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete whole function from end`() {
|
fun `test delete whole function from end`() {
|
||||||
doTest(
|
doTest(
|
||||||
"d%",
|
"d%",
|
||||||
@ -324,11 +343,11 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts "hello"
|
puts "hello"
|
||||||
en${c}d
|
en${c}d
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
"",
|
"", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
fileName = "ruby.rb"
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete whole function from end with reverse motion`() {
|
fun `test delete whole function from end with reverse motion`() {
|
||||||
doTest(
|
doTest(
|
||||||
"dg%",
|
"dg%",
|
||||||
@ -337,8 +356,7 @@ class MatchitGeneralTest : VimTestCase() {
|
|||||||
puts "hello"
|
puts "hello"
|
||||||
en${c}d
|
en${c}d
|
||||||
""".trimIndent(),
|
""".trimIndent(),
|
||||||
"",
|
"", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE, "ruby.rb"
|
||||||
fileName = "ruby.rb"
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,8 @@ package org.jetbrains.plugins.ideavim.extension.matchit
|
|||||||
|
|
||||||
import com.intellij.ide.highlighter.HtmlFileType
|
import com.intellij.ide.highlighter.HtmlFileType
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class MatchitHtmlTest : VimTestCase() {
|
class MatchitHtmlTest : VimTestCase() {
|
||||||
@ -29,6 +31,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
enableExtensions("matchit")
|
enableExtensions("matchit")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test basic jump to closing tag`() {
|
fun `test basic jump to closing tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -42,6 +45,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test basic jump to opening tag`() {
|
fun `test basic jump to opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -55,6 +59,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test multiline jump to closing tag`() {
|
fun `test multiline jump to closing tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -72,6 +77,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test multiline jump to opening tag`() {
|
fun `test multiline jump to opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -89,6 +95,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to closing tag while ignoring nested tags`() {
|
fun `test jump to closing tag while ignoring nested tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -110,6 +117,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to closing tag while ignoring outer tags`() {
|
fun `test jump to closing tag while ignoring outer tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -127,6 +135,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to opening tag while ignoring nested tags`() {
|
fun `test jump to opening tag while ignoring nested tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -148,6 +157,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to opening tag while ignoring outer tags`() {
|
fun `test jump to opening tag while ignoring outer tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -165,6 +175,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to closing tag while in tag attributes`() {
|
fun `test jump to closing tag while in tag attributes`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -178,6 +189,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't jump on standalone tags`() {
|
fun `test don't jump on standalone tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -195,6 +207,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't jump on empty lines`() {
|
fun `test don't jump on empty lines`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -212,6 +225,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump forwards to matching angle bracket on opening tag`() {
|
fun `test jump forwards to matching angle bracket on opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -225,6 +239,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump forwards to matching angle bracket when on whitespace`() {
|
fun `test jump forwards to matching angle bracket when on whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -234,6 +249,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to last angle bracket when in tag body`() {
|
fun `test jump to last angle bracket when in tag body`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -247,6 +263,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump forwards to matching angle bracket on closing tag`() {
|
fun `test jump forwards to matching angle bracket on closing tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -260,6 +277,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump backwards to matching angle bracket on opening tag`() {
|
fun `test jump backwards to matching angle bracket on opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -273,6 +291,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump backwards to matching angle bracket on closing tag`() {
|
fun `test jump backwards to matching angle bracket on closing tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -286,6 +305,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to matching square bracket inside tag`() {
|
fun `test jump to matching square bracket inside tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -299,6 +319,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to matching parenthesis inside tag`() {
|
fun `test jump to matching parenthesis inside tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -312,6 +333,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to matching curly brace in tag body`() {
|
fun `test jump to matching curly brace in tag body`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -325,6 +347,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to closing tag when inside brackets in opening tag`() {
|
fun `test jump to closing tag when inside brackets in opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -338,6 +361,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump to opening curly brace when in tag body`() {
|
fun `test jump to opening curly brace when in tag body`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -351,6 +375,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't jump on standalone tag with brackets on the same line`() {
|
fun `test don't jump on standalone tag with brackets on the same line`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -364,6 +389,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from opening to closing tag while ignoring comments`() {
|
fun `test jump from opening to closing tag while ignoring comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -393,6 +419,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from closing to opening tag while ignoring comments`() {
|
fun `test jump from closing to opening tag while ignoring comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -422,6 +449,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from opening to closing tag inside a comment block`() {
|
fun `test jump from opening to closing tag inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -439,6 +467,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from closing to opening tag inside a comment block`() {
|
fun `test jump from closing to opening tag inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -456,6 +485,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from opening to closing angle bracket inside a comment block`() {
|
fun `test jump from opening to closing angle bracket inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -473,6 +503,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from closing to opening angle bracket inside a comment block`() {
|
fun `test jump from closing to opening angle bracket inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -490,6 +521,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from opening to closing angle bracket on a comment marker`() {
|
fun `test jump from opening to closing angle bracket on a comment marker`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -507,6 +539,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from opening to closing angle bracket ignoring bracket in string`() {
|
fun `test jump from opening to closing angle bracket ignoring bracket in string`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
@ -524,6 +557,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
* g% motion tests. For HTML, g% should behave the same as %.
|
* g% motion tests. For HTML, g% should behave the same as %.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing tag`() {
|
fun `test reverse jump to closing tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -537,6 +571,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to opening tag`() {
|
fun `test reverse jump to opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -550,6 +585,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing tag while ignoring nested tags`() {
|
fun `test reverse jump to closing tag while ignoring nested tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -571,6 +607,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing tag while ignoring outer tags`() {
|
fun `test reverse jump to closing tag while ignoring outer tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -588,6 +625,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to opening tag while ignoring nested tags`() {
|
fun `test reverse jump to opening tag while ignoring nested tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -609,6 +647,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to opening tag while ignoring outer tags`() {
|
fun `test reverse jump to opening tag while ignoring outer tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -626,6 +665,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing tag while in tag attributes`() {
|
fun `test reverse jump to closing tag while in tag attributes`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -639,6 +679,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't reverse jump on standalone tags`() {
|
fun `test don't reverse jump on standalone tags`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -656,6 +697,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't reverse jump on empty lines`() {
|
fun `test don't reverse jump on empty lines`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -673,6 +715,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing angle bracket`() {
|
fun `test reverse jump to closing angle bracket`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -686,6 +729,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing angle bracket when on whitespace`() {
|
fun `test reverse jump to closing angle bracket when on whitespace`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -695,6 +739,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to last angle bracket when in tag body`() {
|
fun `test reverse jump to last angle bracket when in tag body`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -708,6 +753,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to opening angle bracket`() {
|
fun `test reverse jump to opening angle bracket`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -721,6 +767,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to matching square bracket inside tag`() {
|
fun `test reverse jump to matching square bracket inside tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -734,6 +781,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to matching parenthesis inside tag`() {
|
fun `test reverse jump to matching parenthesis inside tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -747,6 +795,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to matching curly brace in tag body`() {
|
fun `test reverse jump to matching curly brace in tag body`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -760,6 +809,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to closing tag when inside brackets in opening tag`() {
|
fun `test reverse jump to closing tag when inside brackets in opening tag`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -773,6 +823,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump to opening curly brace when in tag body`() {
|
fun `test reverse jump to opening curly brace when in tag body`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -786,6 +837,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test don't reverse jump on standalone tag with brackets on the same line`() {
|
fun `test don't reverse jump on standalone tag with brackets on the same line`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -799,6 +851,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from opening to closing tag while ignoring comments`() {
|
fun `test reverse jump from opening to closing tag while ignoring comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -828,6 +881,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from closing to opening tag while ignoring comments`() {
|
fun `test reverse jump from closing to opening tag while ignoring comments`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -857,6 +911,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from opening to closing tag inside a comment block`() {
|
fun `test reverse jump from opening to closing tag inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -874,6 +929,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from closing to opening tag inside a comment block`() {
|
fun `test reverse jump from closing to opening tag inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -891,6 +947,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from opening to closing angle bracket inside a comment block`() {
|
fun `test reverse jump from opening to closing angle bracket inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -908,6 +965,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from closing to opening angle bracket inside a comment block`() {
|
fun `test reverse jump from closing to opening angle bracket inside a comment block`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -925,6 +983,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from opening to closing angle bracket on a comment marker`() {
|
fun `test reverse jump from opening to closing angle bracket on a comment marker`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -942,6 +1001,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test reverse jump from opening to closing angle bracket ignoring bracket in string`() {
|
fun `test reverse jump from opening to closing angle bracket ignoring bracket in string`() {
|
||||||
doTest(
|
doTest(
|
||||||
"g%",
|
"g%",
|
||||||
@ -955,6 +1015,7 @@ class MatchitHtmlTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test jump from multiline opening tag to closing`() {
|
fun `test jump from multiline opening tag to closing`() {
|
||||||
doTest(
|
doTest(
|
||||||
"%",
|
"%",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -34,6 +34,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
enableExtensions("multiple-cursors")
|
enableExtensions("multiple-cursors")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testNextOccurrence() {
|
fun testNextOccurrence() {
|
||||||
val before = """public class ChangeLineAction extends EditorAction {
|
val before = """public class ChangeLineAction extends EditorAction {
|
||||||
public ChangeLineAction() {
|
public ChangeLineAction() {
|
||||||
@ -73,6 +74,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testAllOccurrencesIterative() {
|
fun testAllOccurrencesIterative() {
|
||||||
val before = """public class ChangeLineAction extends EditorAction {
|
val before = """public class ChangeLineAction extends EditorAction {
|
||||||
public ChangeLineAction() {
|
public ChangeLineAction() {
|
||||||
@ -112,6 +114,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testNotWholeOccurrence() {
|
fun testNotWholeOccurrence() {
|
||||||
val before = """Int
|
val before = """Int
|
||||||
|Integer
|
|Integer
|
||||||
@ -136,6 +139,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectSubstring() {
|
fun testSelectSubstring() {
|
||||||
val before = """q${c}we
|
val before = """q${c}we
|
||||||
|asdqweasd
|
|asdqweasd
|
||||||
@ -154,6 +158,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectSingleOccurrence() {
|
fun testSelectSingleOccurrence() {
|
||||||
val before = """q${c}we
|
val before = """q${c}we
|
||||||
|asd
|
|asd
|
||||||
@ -176,6 +181,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectionWithMultipleCarets() {
|
fun testSelectionWithMultipleCarets() {
|
||||||
val before = """qwe
|
val before = """qwe
|
||||||
|sdfgdfs${c}fdasfg
|
|sdfgdfs${c}fdasfg
|
||||||
@ -189,6 +195,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(before)
|
assertState(before)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectAll() {
|
fun testSelectAll() {
|
||||||
val before = """qwe
|
val before = """qwe
|
||||||
|asd
|
|asd
|
||||||
@ -209,6 +216,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectAllNotWhole() {
|
fun testSelectAllNotWhole() {
|
||||||
val before = """Int
|
val before = """Int
|
||||||
|Integer
|
|Integer
|
||||||
@ -232,6 +240,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectAllSingleOccurrence() {
|
fun testSelectAllSingleOccurrence() {
|
||||||
val before = """qwe
|
val before = """qwe
|
||||||
|asd
|
|asd
|
||||||
@ -258,6 +267,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
"additional cursors. IdeaVim has native support, so doesn't track if a selection is due to an additional cursor " +
|
"additional cursors. IdeaVim has native support, so doesn't track if a selection is due to an additional cursor " +
|
||||||
"so IdeaVim will remove arbitrary selections, while vim-multiple-cursors do not."
|
"so IdeaVim will remove arbitrary selections, while vim-multiple-cursors do not."
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testRemoveSelectionVisualMode() {
|
fun testRemoveSelectionVisualMode() {
|
||||||
val before = """q${s}we
|
val before = """q${s}we
|
||||||
|dsgkldfjs ldfl gkjsdsl kj
|
|dsgkldfjs ldfl gkjsdsl kj
|
||||||
@ -277,6 +287,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testRemoveSubSelection() {
|
fun testRemoveSubSelection() {
|
||||||
val before = """Int
|
val before = """Int
|
||||||
|kekInteger
|
|kekInteger
|
||||||
@ -293,6 +304,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testRemoveOccurrence() {
|
fun testRemoveOccurrence() {
|
||||||
val before = """private i${c}nt a = 0;
|
val before = """private i${c}nt a = 0;
|
||||||
|private int b = 1;
|
|private int b = 1;
|
||||||
@ -313,6 +325,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSkipOccurrence() {
|
fun testSkipOccurrence() {
|
||||||
val before = """pr${c}ivate int a = 0;
|
val before = """pr${c}ivate int a = 0;
|
||||||
|private int b = 1;
|
|private int b = 1;
|
||||||
@ -330,6 +343,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSkipAndThenSelectAllOccurrences() {
|
fun testSkipAndThenSelectAllOccurrences() {
|
||||||
val before = """pr${c}ivate int a = 0;
|
val before = """pr${c}ivate int a = 0;
|
||||||
|private int b = 1;
|
|private int b = 1;
|
||||||
@ -347,6 +361,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSeveralActions() {
|
fun testSeveralActions() {
|
||||||
val before = """public class Main {
|
val before = """public class Main {
|
||||||
| public static void main(String[] args) {
|
| public static void main(String[] args) {
|
||||||
@ -415,6 +430,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(afterInsert)
|
assertState(afterInsert)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSelectTwice() {
|
fun testSelectTwice() {
|
||||||
val before = """qwe
|
val before = """qwe
|
||||||
|asd
|
|asd
|
||||||
@ -439,6 +455,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSkipSelectionSubstring() {
|
fun testSkipSelectionSubstring() {
|
||||||
val before = """qw${c}e
|
val before = """qw${c}e
|
||||||
|asdqweasd
|
|asdqweasd
|
||||||
@ -459,6 +476,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testSkipSelectionVisualMode() {
|
fun testSkipSelectionVisualMode() {
|
||||||
val before = """q${s}we
|
val before = """q${s}we
|
||||||
|dsgkldfjs ldfl gkjsdsl kj
|
|dsgkldfjs ldfl gkjsdsl kj
|
||||||
@ -473,6 +491,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(before)
|
assertState(before)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testAddSelectionVisualMode() {
|
fun testAddSelectionVisualMode() {
|
||||||
val before = """jdfsg sdf${c}dfkgjhfkgkldfjsg
|
val before = """jdfsg sdf${c}dfkgjhfkgkldfjsg
|
||||||
|dfkjghdfsgs
|
|dfkjghdfsgs
|
||||||
@ -487,6 +506,7 @@ class VimMultipleCursorsExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun testNextOccurrenceCaseSensitive() {
|
fun testNextOccurrenceCaseSensitive() {
|
||||||
val before = """@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
val before = """@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun getCellType(${c}pos: VisualPosition): CellType {
|
fun getCellType(${c}pos: VisualPosition): CellType {
|
||||||
@ -537,6 +557,7 @@ fun getCellType(${s}pos$se: VisualPosition): CellType {
|
|||||||
doTest(keys, before, after, VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
doTest(keys, before, after, VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test pattern is always case sensitive`() {
|
fun `test pattern is always case sensitive`() {
|
||||||
val before = """test ${c}Test tEst TeSt tEST Test test Test test"""
|
val before = """test ${c}Test tEst TeSt tEST Test test Test test"""
|
||||||
configureByText(before)
|
configureByText(before)
|
||||||
@ -547,6 +568,7 @@ fun getCellType(${s}pos$se: VisualPosition): CellType {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test ignores regex in search pattern`() {
|
fun `test ignores regex in search pattern`() {
|
||||||
val before = "test ${s}t.*st${c}$se toast tallest t.*st"
|
val before = "test ${s}t.*st${c}$se toast tallest t.*st"
|
||||||
val editor = configureByText(before)
|
val editor = configureByText(before)
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
package org.jetbrains.plugins.ideavim.extension.paragraphmotion
|
package org.jetbrains.plugins.ideavim.extension.paragraphmotion
|
||||||
|
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
class ParagraphMotionTest : VimTestCase() {
|
class ParagraphMotionTest : VimTestCase() {
|
||||||
@ -28,6 +30,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
enableExtensions("vim-paragraph-motion")
|
enableExtensions("vim-paragraph-motion")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph next without whitespace`() {
|
fun `test paragraph next without whitespace`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|${c}all rocks and lavender and tufted grass,
|
|${c}all rocks and lavender and tufted grass,
|
||||||
@ -42,6 +45,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("}", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("}", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph next with whitespace`() {
|
fun `test paragraph next with whitespace`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|${c}all rocks and lavender and tufted grass,
|
|${c}all rocks and lavender and tufted grass,
|
||||||
@ -56,6 +60,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("}", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("}", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph next with whitespace visual`() {
|
fun `test paragraph next with whitespace visual`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|${c}all rocks and lavender and tufted grass,
|
|${c}all rocks and lavender and tufted grass,
|
||||||
@ -70,6 +75,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("v}", before, after, VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
doTest("v}", before, after, VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph next with whitespace delete`() {
|
fun `test paragraph next with whitespace delete`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|${c}all rocks and lavender and tufted grass,
|
|${c}all rocks and lavender and tufted grass,
|
||||||
@ -84,6 +90,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("d}", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("d}", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph prev without whitespace`() {
|
fun `test paragraph prev without whitespace`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|all rocks and lavender and tufted grass,
|
|all rocks and lavender and tufted grass,
|
||||||
@ -98,6 +105,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("{", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("{", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph prev with whitespace`() {
|
fun `test paragraph prev with whitespace`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|all rocks and lavender and tufted grass,
|
|all rocks and lavender and tufted grass,
|
||||||
@ -112,6 +120,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("{", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("{", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph prev with whitespace visual`() {
|
fun `test paragraph prev with whitespace visual`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|all rocks and lavender and tufted grass,
|
|all rocks and lavender and tufted grass,
|
||||||
@ -126,6 +135,7 @@ class ParagraphMotionTest : VimTestCase() {
|
|||||||
doTest("v{", before, after, VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
doTest("v{", before, after, VimStateMachine.Mode.VISUAL, VimStateMachine.SubMode.VISUAL_CHARACTER)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test paragraph prev with whitespace delete`() {
|
fun `test paragraph prev with whitespace delete`() {
|
||||||
val before = """I found it in a legendary land
|
val before = """I found it in a legendary land
|
||||||
|all rocks and lavender and tufted grass,
|
|all rocks and lavender and tufted grass,
|
||||||
|
@ -25,6 +25,8 @@ import com.maddyhome.idea.vim.command.VimStateMachine
|
|||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
import com.maddyhome.idea.vim.newapi.vim
|
import com.maddyhome.idea.vim.newapi.vim
|
||||||
import com.maddyhome.idea.vim.register.RegisterConstants.UNNAMED_REGISTER
|
import com.maddyhome.idea.vim.register.RegisterConstants.UNNAMED_REGISTER
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
import org.jetbrains.plugins.ideavim.rangeOf
|
import org.jetbrains.plugins.ideavim.rangeOf
|
||||||
|
|
||||||
@ -35,6 +37,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
enableExtensions("ReplaceWithRegister")
|
enableExtensions("ReplaceWithRegister")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace with empty register`() {
|
fun `test replace with empty register`() {
|
||||||
val text = "one ${c}two three"
|
val text = "one ${c}two three"
|
||||||
VimPlugin.getRegister().resetRegisters()
|
VimPlugin.getRegister().resetRegisters()
|
||||||
@ -44,6 +47,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertState(text)
|
assertState(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test simple replace`() {
|
fun `test simple replace`() {
|
||||||
val text = "one ${c}two three"
|
val text = "one ${c}two three"
|
||||||
|
|
||||||
@ -54,6 +58,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertEquals("one", VimPlugin.getRegister().lastRegister?.text)
|
assertEquals("one", VimPlugin.getRegister().lastRegister?.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test empty text`() {
|
fun `test empty text`() {
|
||||||
val text = ""
|
val text = ""
|
||||||
|
|
||||||
@ -63,6 +68,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertState("on${c}e")
|
assertState("on${c}e")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace with empty text`() {
|
fun `test replace with empty text`() {
|
||||||
val text = "${c}one"
|
val text = "${c}one"
|
||||||
|
|
||||||
@ -72,6 +78,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertState(c)
|
assertState(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace use different register`() {
|
fun `test replace use different register`() {
|
||||||
val text = "one ${c}two three four"
|
val text = "one ${c}two three four"
|
||||||
|
|
||||||
@ -84,6 +91,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertEquals("two", VimPlugin.getRegister().lastRegister?.text)
|
assertEquals("two", VimPlugin.getRegister().lastRegister?.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace use clipboard register`() {
|
fun `test replace use clipboard register`() {
|
||||||
val text = "one ${c}two three four"
|
val text = "one ${c}two three four"
|
||||||
|
|
||||||
@ -93,6 +101,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertEquals("two", VimPlugin.getRegister().lastRegister?.text)
|
assertEquals("two", VimPlugin.getRegister().lastRegister?.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace use wrong register`() {
|
fun `test replace use wrong register`() {
|
||||||
val text = "one ${c}two three"
|
val text = "one ${c}two three"
|
||||||
|
|
||||||
@ -101,6 +110,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertState(text)
|
assertState(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace with line`() {
|
fun `test replace with line`() {
|
||||||
val text = """
|
val text = """
|
||||||
|I fou${c}nd it in a legendary land|
|
|I fou${c}nd it in a legendary land|
|
||||||
@ -117,6 +127,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace with line with clipboard register`() {
|
fun `test replace with line with clipboard register`() {
|
||||||
val text = """
|
val text = """
|
||||||
|I fou${c}nd it in a legendary land|
|
|I fou${c}nd it in a legendary land|
|
||||||
@ -133,6 +144,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace block selection`() {
|
fun `test replace block selection`() {
|
||||||
val text = """
|
val text = """
|
||||||
${c}one two three
|
${c}one two three
|
||||||
@ -153,6 +165,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace with number`() {
|
fun `test replace with number`() {
|
||||||
val text = "one ${c}two three four"
|
val text = "one ${c}two three four"
|
||||||
|
|
||||||
@ -164,6 +177,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VimBehaviorDiffers("one on${c}e on${c}e four")
|
@VimBehaviorDiffers("one on${c}e on${c}e four")
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test replace with multiple carets`() {
|
fun `test replace with multiple carets`() {
|
||||||
val text = "one ${c}two ${c}three four"
|
val text = "one ${c}two ${c}three four"
|
||||||
|
|
||||||
@ -174,6 +188,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertEquals("one", VimPlugin.getRegister().lastRegister?.text)
|
assertEquals("one", VimPlugin.getRegister().lastRegister?.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test dot repeat`() {
|
fun `test dot repeat`() {
|
||||||
val text = "one ${c}two three four"
|
val text = "one ${c}two three four"
|
||||||
|
|
||||||
@ -186,6 +201,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
|
|
||||||
// --------------------------------------- grr --------------------------
|
// --------------------------------------- grr --------------------------
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line replace`() {
|
fun `test line replace`() {
|
||||||
val text = """
|
val text = """
|
||||||
I found it in ${c}a legendary land
|
I found it in ${c}a legendary land
|
||||||
@ -208,6 +224,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertEquals("legendary", VimPlugin.getRegister().lastRegister?.text)
|
assertEquals("legendary", VimPlugin.getRegister().lastRegister?.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line replace with line`() {
|
fun `test line replace with line`() {
|
||||||
val text = """
|
val text = """
|
||||||
I found it in ${c}a legendary land
|
I found it in ${c}a legendary land
|
||||||
@ -228,6 +245,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line replace with line empty line`() {
|
fun `test line replace with line empty line`() {
|
||||||
val text = """
|
val text = """
|
||||||
I found it in ${c}a legendary land
|
I found it in ${c}a legendary land
|
||||||
@ -251,6 +269,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@VimBehaviorDiffers(description = "Where is the new line comes from?...")
|
@VimBehaviorDiffers(description = "Where is the new line comes from?...")
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line replace with block`() {
|
fun `test line replace with block`() {
|
||||||
val text = """
|
val text = """
|
||||||
${c}one two three
|
${c}one two three
|
||||||
@ -281,6 +300,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
hard by the torrent of a mountain pass.
|
hard by the torrent of a mountain pass.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line with number`() {
|
fun `test line with number`() {
|
||||||
val text = """
|
val text = """
|
||||||
I found it in ${c}a legendary land
|
I found it in ${c}a legendary land
|
||||||
@ -301,6 +321,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line dot repeat`() {
|
fun `test line dot repeat`() {
|
||||||
val text = """
|
val text = """
|
||||||
I found it in ${c}a legendary land
|
I found it in ${c}a legendary land
|
||||||
@ -329,6 +350,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
${c}where it was settled on some sodden sand
|
${c}where it was settled on some sodden sand
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test line multicaret`() {
|
fun `test line multicaret`() {
|
||||||
val text = """
|
val text = """
|
||||||
I found it in ${c}a legendary land
|
I found it in ${c}a legendary land
|
||||||
@ -352,6 +374,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
|
|
||||||
// ------------------------------------- gr + visual ----------------------
|
// ------------------------------------- gr + visual ----------------------
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual replace`() {
|
fun `test visual replace`() {
|
||||||
val text = """
|
val text = """
|
||||||
I ${c}found it in a legendary land
|
I ${c}found it in a legendary land
|
||||||
@ -375,6 +398,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertMode(VimStateMachine.Mode.COMMAND)
|
assertMode(VimStateMachine.Mode.COMMAND)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual replace with line`() {
|
fun `test visual replace with line`() {
|
||||||
val text = """
|
val text = """
|
||||||
|I fo${c}und it in a legendary land|
|
|I fo${c}und it in a legendary land|
|
||||||
@ -396,6 +420,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertMode(VimStateMachine.Mode.COMMAND)
|
assertMode(VimStateMachine.Mode.COMMAND)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual replace with two lines`() {
|
fun `test visual replace with two lines`() {
|
||||||
val text = """
|
val text = """
|
||||||
|I found it in ${c}a legendary land|
|
|I found it in ${c}a legendary land|
|
||||||
@ -418,6 +443,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertMode(VimStateMachine.Mode.COMMAND)
|
assertMode(VimStateMachine.Mode.COMMAND)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual line replace`() {
|
fun `test visual line replace`() {
|
||||||
val text = """
|
val text = """
|
||||||
I fo${c}und it in a legendary land
|
I fo${c}und it in a legendary land
|
||||||
@ -440,6 +466,7 @@ class ReplaceWithRegisterTest : VimTestCase() {
|
|||||||
assertMode(VimStateMachine.Mode.COMMAND)
|
assertMode(VimStateMachine.Mode.COMMAND)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(reason = SkipNeovimReason.PLUGIN)
|
||||||
fun `test visual line replace with line`() {
|
fun `test visual line replace with line`() {
|
||||||
val text = """
|
val text = """
|
||||||
I fo${c}und it in a legendary land
|
I fo${c}und it in a legendary land
|
||||||
|
@ -23,6 +23,8 @@ package org.jetbrains.plugins.ideavim.extension.surround
|
|||||||
import com.maddyhome.idea.vim.api.injector
|
import com.maddyhome.idea.vim.api.injector
|
||||||
import com.maddyhome.idea.vim.command.VimStateMachine
|
import com.maddyhome.idea.vim.command.VimStateMachine
|
||||||
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
import com.maddyhome.idea.vim.helper.VimBehaviorDiffers
|
||||||
|
import org.jetbrains.plugins.ideavim.SkipNeovimReason
|
||||||
|
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
|
||||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,6 +39,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
|
|
||||||
/* surround */
|
/* surround */
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundWordParens() {
|
fun testSurroundWordParens() {
|
||||||
val before = "if ${c}condition {\n" + "}\n"
|
val before = "if ${c}condition {\n" + "}\n"
|
||||||
val after = "if ${c}(condition) {\n" + "}\n"
|
val after = "if ${c}(condition) {\n" + "}\n"
|
||||||
@ -46,6 +49,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("yse(", before, "if ( condition ) {\n" + "}\n", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yse(", before, "if ( condition ) {\n" + "}\n", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundWORDBlock() {
|
fun testSurroundWORDBlock() {
|
||||||
val before = "if (condition) ${c}return;\n"
|
val before = "if (condition) ${c}return;\n"
|
||||||
val after = "if (condition) {return;}\n"
|
val after = "if (condition) {return;}\n"
|
||||||
@ -55,6 +59,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ysE{", before, "if (condition) { return; }\n", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ysE{", before, "if (condition) { return; }\n", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundWordArray() {
|
fun testSurroundWordArray() {
|
||||||
val before = "int foo = bar${c}index;"
|
val before = "int foo = bar${c}index;"
|
||||||
val after = "int foo = bar[index];"
|
val after = "int foo = bar[index];"
|
||||||
@ -64,6 +69,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("yse[", before, "int foo = bar[ index ];", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yse[", before, "int foo = bar[ index ];", VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundWordAngle() {
|
fun testSurroundWordAngle() {
|
||||||
val before = "foo = new Bar${c}Baz();"
|
val before = "foo = new Bar${c}Baz();"
|
||||||
val after = "foo = new Bar<Baz>();"
|
val after = "foo = new Bar<Baz>();"
|
||||||
@ -72,6 +78,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("yse>", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yse>", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundQuotes() {
|
fun testSurroundQuotes() {
|
||||||
val before = "foo = ${c}new Bar.Baz;"
|
val before = "foo = ${c}new Bar.Baz;"
|
||||||
val after = "foo = \"new Bar.Baz\";"
|
val after = "foo = \"new Bar.Baz\";"
|
||||||
@ -80,6 +87,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ys4w\"", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ys4w\"", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundTag() {
|
fun testSurroundTag() {
|
||||||
configureByText("Hello ${c}World!\n")
|
configureByText("Hello ${c}World!\n")
|
||||||
typeText(injector.parser.parseKeys("ysiw<em>"))
|
typeText(injector.parser.parseKeys("ysiw<em>"))
|
||||||
@ -87,6 +95,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VIM-1569
|
// VIM-1569
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundTagWithAttributes() {
|
fun testSurroundTagWithAttributes() {
|
||||||
configureByText("Hello ${c}World!")
|
configureByText("Hello ${c}World!")
|
||||||
typeText(injector.parser.parseKeys("ysiw<span class=\"important\" data-foo=\"bar\">"))
|
typeText(injector.parser.parseKeys("ysiw<span class=\"important\" data-foo=\"bar\">"))
|
||||||
@ -94,24 +103,28 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VIM-1569
|
// VIM-1569
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurraungTagAsInIssue() {
|
fun testSurraungTagAsInIssue() {
|
||||||
configureByText("<p>${c}Hello</p>")
|
configureByText("<p>${c}Hello</p>")
|
||||||
typeText(injector.parser.parseKeys("VS<div class = \"container\">"))
|
typeText(injector.parser.parseKeys("VS<div class = \"container\">"))
|
||||||
assertState("<div class = \"container\"><p>Hello</p></div>")
|
assertState("<div class = \"container\"><p>Hello</p></div>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundCustomElement() {
|
fun testSurroundCustomElement() {
|
||||||
configureByText("${c}Click me!")
|
configureByText("${c}Click me!")
|
||||||
typeText(injector.parser.parseKeys("VS<custom-button>"))
|
typeText(injector.parser.parseKeys("VS<custom-button>"))
|
||||||
assertState("<custom-button>Click me!</custom-button>")
|
assertState("<custom-button>Click me!</custom-button>")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundFunctionName() {
|
fun testSurroundFunctionName() {
|
||||||
configureByText("foo = b${c}ar")
|
configureByText("foo = b${c}ar")
|
||||||
typeText(injector.parser.parseKeys("ysiwfbaz"))
|
typeText(injector.parser.parseKeys("ysiwfbaz"))
|
||||||
assertState("foo = ${c}baz(bar)")
|
assertState("foo = ${c}baz(bar)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundFunctionNameDoesNothingIfInputIsEmpty() {
|
fun testSurroundFunctionNameDoesNothingIfInputIsEmpty() {
|
||||||
// The cursor does not move. This is different from Vim
|
// The cursor does not move. This is different from Vim
|
||||||
// where the cursor moves to the beginning of the text object.
|
// where the cursor moves to the beginning of the text object.
|
||||||
@ -120,18 +133,21 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
assertState("foo = b${c}ar")
|
assertState("foo = b${c}ar")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundFunctionNameWithInnerSpacing() {
|
fun testSurroundFunctionNameWithInnerSpacing() {
|
||||||
configureByText("foo = b${c}ar")
|
configureByText("foo = b${c}ar")
|
||||||
typeText(injector.parser.parseKeys("ysiwFbaz"))
|
typeText(injector.parser.parseKeys("ysiwFbaz"))
|
||||||
assertState("foo = ${c}baz( bar )")
|
assertState("foo = ${c}baz( bar )")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundSpace() {
|
fun testSurroundSpace() {
|
||||||
configureByText("foo(b${c}ar)")
|
configureByText("foo(b${c}ar)")
|
||||||
typeText(injector.parser.parseKeys("csbs"))
|
typeText(injector.parser.parseKeys("csbs"))
|
||||||
assertState("foo${c} bar")
|
assertState("foo${c} bar")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatSurround() {
|
fun testRepeatSurround() {
|
||||||
val before = "if ${c}condition {\n}\n"
|
val before = "if ${c}condition {\n}\n"
|
||||||
val after = "if ((condition)) {\n}\n"
|
val after = "if ((condition)) {\n}\n"
|
||||||
@ -139,6 +155,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("ysiw)", "l", "."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("ysiw)", "l", "."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatSurroundDouble() {
|
fun testRepeatSurroundDouble() {
|
||||||
val before = "if ${c}condition {\n}\n"
|
val before = "if ${c}condition {\n}\n"
|
||||||
val after = "if (((condition))) {\n}\n"
|
val after = "if (((condition))) {\n}\n"
|
||||||
@ -146,6 +163,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("ysiw)", "l", ".", "l", "."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("ysiw)", "l", ".", "l", "."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatDifferentChanges() {
|
fun testRepeatDifferentChanges() {
|
||||||
val before = """
|
val before = """
|
||||||
if "${c}condition" { }
|
if "${c}condition" { }
|
||||||
@ -159,6 +177,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("ysiw)", "cs\"'", "j", "."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("ysiw)", "cs\"'", "j", "."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatWrapWithFunction() {
|
fun testRepeatWrapWithFunction() {
|
||||||
val before = """
|
val before = """
|
||||||
if "${c}condition" { }
|
if "${c}condition" { }
|
||||||
@ -178,6 +197,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatWrapWithTag() {
|
fun testRepeatWrapWithTag() {
|
||||||
val before = """
|
val before = """
|
||||||
${c}abc
|
${c}abc
|
||||||
@ -193,6 +213,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
|
|
||||||
/* visual surround */
|
/* visual surround */
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testVisualSurroundWordParens() {
|
fun testVisualSurroundWordParens() {
|
||||||
val before = "if ${c}condition {\n" + "}\n"
|
val before = "if ${c}condition {\n" + "}\n"
|
||||||
val after = "if ${c}(condition) {\n" + "}\n"
|
val after = "if ${c}(condition) {\n" + "}\n"
|
||||||
@ -210,6 +231,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
|
|
||||||
/* Delete surroundings */
|
/* Delete surroundings */
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingParens() {
|
fun testDeleteSurroundingParens() {
|
||||||
val before = "if (${c}condition) {\n" + "}\n"
|
val before = "if (${c}condition) {\n" + "}\n"
|
||||||
val after = "if condition {\n" + "}\n"
|
val after = "if condition {\n" + "}\n"
|
||||||
@ -219,6 +241,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ds)", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ds)", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingQuote() {
|
fun testDeleteSurroundingQuote() {
|
||||||
val before = "if (\"${c}foo\".equals(foo)) {\n" + "}\n"
|
val before = "if (\"${c}foo\".equals(foo)) {\n" + "}\n"
|
||||||
val after = "if (${c}foo.equals(foo)) {\n" + "}\n"
|
val after = "if (${c}foo.equals(foo)) {\n" + "}\n"
|
||||||
@ -226,6 +249,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ds\"", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ds\"", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingBlock() {
|
fun testDeleteSurroundingBlock() {
|
||||||
val before = "if (condition) {${c}return;}\n"
|
val before = "if (condition) {${c}return;}\n"
|
||||||
val after = "if (condition) return;\n"
|
val after = "if (condition) return;\n"
|
||||||
@ -235,6 +259,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ds{", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ds{", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingArray() {
|
fun testDeleteSurroundingArray() {
|
||||||
val before = "int foo = bar[${c}index];"
|
val before = "int foo = bar[${c}index];"
|
||||||
val after = "int foo = barindex;"
|
val after = "int foo = barindex;"
|
||||||
@ -244,6 +269,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ds[", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ds[", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingAngle() {
|
fun testDeleteSurroundingAngle() {
|
||||||
val before = "foo = new Bar<${c}Baz>();"
|
val before = "foo = new Bar<${c}Baz>();"
|
||||||
val after = "foo = new BarBaz();"
|
val after = "foo = new BarBaz();"
|
||||||
@ -253,6 +279,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("ds<", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("ds<", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingTag() {
|
fun testDeleteSurroundingTag() {
|
||||||
val before = "<div><p>${c}Foo</p></div>"
|
val before = "<div><p>${c}Foo</p></div>"
|
||||||
val after = "<div>${c}Foo</div>"
|
val after = "<div>${c}Foo</div>"
|
||||||
@ -261,6 +288,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VIM-1085
|
// VIM-1085
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteSurroundingParamsAtLineEnd() {
|
fun testDeleteSurroundingParamsAtLineEnd() {
|
||||||
val before = "Foo\n" + "Seq(\"-${c}Yrangepos\")\n"
|
val before = "Foo\n" + "Seq(\"-${c}Yrangepos\")\n"
|
||||||
val after = "Foo\n" + "Seq\"-Yrangepos\"\n"
|
val after = "Foo\n" + "Seq\"-Yrangepos\"\n"
|
||||||
@ -269,6 +297,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VIM-1085
|
// VIM-1085
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteMultiLineSurroundingParamsAtLineEnd() {
|
fun testDeleteMultiLineSurroundingParamsAtLineEnd() {
|
||||||
val before = "Foo\n" +
|
val before = "Foo\n" +
|
||||||
"Bar\n" +
|
"Bar\n" +
|
||||||
@ -285,6 +314,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VIM-2227
|
// VIM-2227
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testDeleteInvalidSurroundingCharacter() {
|
fun testDeleteInvalidSurroundingCharacter() {
|
||||||
val text = "if (${c}condition) {"
|
val text = "if (${c}condition) {"
|
||||||
|
|
||||||
@ -294,6 +324,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("yibds{", text, text, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("yibds{", text, text, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatDeleteSurroundParens() {
|
fun testRepeatDeleteSurroundParens() {
|
||||||
val before = "if ((${c}condition)) {\n}\n"
|
val before = "if ((${c}condition)) {\n}\n"
|
||||||
val after = "if condition {\n}\n"
|
val after = "if condition {\n}\n"
|
||||||
@ -301,6 +332,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("dsb."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("dsb."), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatDeleteSurroundQuotes() {
|
fun testRepeatDeleteSurroundQuotes() {
|
||||||
val before = "if (\"${c}condition\") {\n}\n"
|
val before = "if (\"${c}condition\") {\n}\n"
|
||||||
val after = "if (condition) {\n}\n"
|
val after = "if (condition) {\n}\n"
|
||||||
@ -310,6 +342,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
|
|
||||||
/* Change surroundings */
|
/* Change surroundings */
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testChangeSurroundingParens() {
|
fun testChangeSurroundingParens() {
|
||||||
val before = "if (${c}condition) {\n" + "}\n"
|
val before = "if (${c}condition) {\n" + "}\n"
|
||||||
val after = "if [condition] {\n" + "}\n"
|
val after = "if [condition] {\n" + "}\n"
|
||||||
@ -317,6 +350,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("csbr"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("csbr"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testChangeSurroundingBlock() {
|
fun testChangeSurroundingBlock() {
|
||||||
val before = "if (condition) {${c}return;}"
|
val before = "if (condition) {${c}return;}"
|
||||||
val after = "if (condition) (return;)"
|
val after = "if (condition) (return;)"
|
||||||
@ -324,6 +358,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("csBb"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("csBb"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testChangeSurroundingTagSimple() {
|
fun testChangeSurroundingTagSimple() {
|
||||||
val before = "<div><p>${c}Foo</p></div>"
|
val before = "<div><p>${c}Foo</p></div>"
|
||||||
val after = "<div>${c}(Foo)</div>"
|
val after = "<div>${c}(Foo)</div>"
|
||||||
@ -331,6 +366,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("cstb"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("cstb"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testChangeSurroundingTagAnotherTag() {
|
fun testChangeSurroundingTagAnotherTag() {
|
||||||
val before = "<div><p>${c}Foo</p></div>"
|
val before = "<div><p>${c}Foo</p></div>"
|
||||||
val after = "<div>${c}<b>Foo</b></div>"
|
val after = "<div>${c}<b>Foo</b></div>"
|
||||||
@ -338,6 +374,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("cst<b>"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("cst<b>"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testRepeatChangeSurroundingParens() {
|
fun testRepeatChangeSurroundingParens() {
|
||||||
val before = "foo(${c}index)(index2) = bar;"
|
val before = "foo(${c}index)(index2) = bar;"
|
||||||
val after = "foo[index][index2] = bar;"
|
val after = "foo[index][index2] = bar;"
|
||||||
@ -346,6 +383,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VIM-2227
|
// VIM-2227
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testChangeInvalidSurroundingCharacter() {
|
fun testChangeInvalidSurroundingCharacter() {
|
||||||
val text = "if (${c}condition) {"
|
val text = "if (${c}condition) {"
|
||||||
|
|
||||||
@ -366,6 +404,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
<p>Some text</p>
|
<p>Some text</p>
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test wrap with tag full line`() {
|
fun `test wrap with tag full line`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("VS<p>"),
|
listOf("VS<p>"),
|
||||||
@ -398,6 +437,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test wrap with tag full line in middle`() {
|
fun `test wrap with tag full line in middle`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("VS<p>"),
|
listOf("VS<p>"),
|
||||||
@ -419,6 +459,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test wrap line with char selection`() {
|
fun `test wrap line with char selection`() {
|
||||||
doTest(
|
doTest(
|
||||||
listOf("vawES<p>"),
|
listOf("vawES<p>"),
|
||||||
@ -440,6 +481,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testWithAnExistingMapping() {
|
fun testWithAnExistingMapping() {
|
||||||
val before = "(foo)"
|
val before = "(foo)"
|
||||||
val after = "[foo]"
|
val after = "[foo]"
|
||||||
@ -451,6 +493,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test change new line`() {
|
fun `test change new line`() {
|
||||||
val before = """
|
val before = """
|
||||||
"\n"
|
"\n"
|
||||||
@ -462,6 +505,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
assertState(after)
|
assertState(after)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testMappingSurroundPlugin() {
|
fun testMappingSurroundPlugin() {
|
||||||
val before = "if (condition) ${c}return;\n"
|
val before = "if (condition) ${c}return;\n"
|
||||||
val after = "if (condition) \"return\";\n"
|
val after = "if (condition) \"return\";\n"
|
||||||
@ -469,6 +513,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(":map gw ysiw\"<CR>gw", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(":map gw ysiw\"<CR>gw", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundPluginWithMacro() {
|
fun testSurroundPluginWithMacro() {
|
||||||
val before = """
|
val before = """
|
||||||
if (con${c}dition) return;
|
if (con${c}dition) return;
|
||||||
@ -482,6 +527,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest("qqds)qj@q", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest("qqds)qj@q", before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun testSurroundPluginWithMacroAndMapping() {
|
fun testSurroundPluginWithMacroAndMapping() {
|
||||||
val before = """
|
val before = """
|
||||||
if (con${c}dition) return;
|
if (con${c}dition) return;
|
||||||
@ -496,6 +542,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(keys, before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test change surround with multicaret`() {
|
fun `test change surround with multicaret`() {
|
||||||
val before = """
|
val before = """
|
||||||
(${c}abc)
|
(${c}abc)
|
||||||
@ -509,6 +556,7 @@ class VimSurroundExtensionTest : VimTestCase() {
|
|||||||
doTest(listOf("cs(]"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
doTest(listOf("cs(]"), before, after, VimStateMachine.Mode.COMMAND, VimStateMachine.SubMode.NONE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestWithoutNeovim(SkipNeovimReason.PLUGIN)
|
||||||
fun `test delete surround with multicaret`() {
|
fun `test delete surround with multicaret`() {
|
||||||
val before = """
|
val before = """
|
||||||
(${c}abc)
|
(${c}abc)
|
||||||
|
@ -64,7 +64,7 @@ class IncrementDecrementTest : VimPropertyTestBase() {
|
|||||||
moveCaretToRandomPlace(env, editor)
|
moveCaretToRandomPlace(env, editor)
|
||||||
|
|
||||||
NeovimTesting.setupEditor(editor, this)
|
NeovimTesting.setupEditor(editor, this)
|
||||||
NeovimTesting.typeCommand(":set nrformats+=octal<CR>", this, editor)
|
NeovimTesting.typeCommand(":set nrformats+=octal<CR>", this)
|
||||||
|
|
||||||
env.executeCommands(Generator.sampledFrom(IncrementDecrementActions(editor, this)))
|
env.executeCommands(Generator.sampledFrom(IncrementDecrementActions(editor, this)))
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ private class IncrementDecrementActions(private val editor: Editor, val test: Vi
|
|||||||
val action = injector.parser.parseKeys(key).single()
|
val action = injector.parser.parseKeys(key).single()
|
||||||
env.logMessage("Use command: ${injector.parser.toKeyNotation(action)}.")
|
env.logMessage("Use command: ${injector.parser.toKeyNotation(action)}.")
|
||||||
VimTestCase.typeText(listOf(action), editor, editor.project)
|
VimTestCase.typeText(listOf(action), editor, editor.project)
|
||||||
NeovimTesting.typeCommand(key, test, editor)
|
NeovimTesting.typeCommand(key, test)
|
||||||
|
|
||||||
IdeEventQueue.getInstance().flushQueue()
|
IdeEventQueue.getInstance().flushQueue()
|
||||||
PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
|
PlatformTestUtil.dispatchAllInvocationEventsInIdeEventQueue()
|
||||||
|
@ -158,8 +158,8 @@ abstract class VimChangeGroupBase : VimChangeGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == null ||
|
if (type == null ||
|
||||||
operatorArguments.mode.inInsertMode || caret.registerStorage.storeText(editor, updatedRange, type, true) ||
|
operatorArguments.mode.inInsertMode || caret.registerStorage.storeText(editor, updatedRange, type, true)
|
||||||
caret != editor.primaryCaret() // sticky tape for VIM-2703 todo remove in the next release
|
|| caret != editor.primaryCaret() // sticky tape for VIM-2703 todo remove in the next release
|
||||||
) {
|
) {
|
||||||
val startOffsets = updatedRange.startOffsets
|
val startOffsets = updatedRange.startOffsets
|
||||||
val endOffsets = updatedRange.endOffsets
|
val endOffsets = updatedRange.endOffsets
|
||||||
|
@ -179,8 +179,7 @@ abstract class VimOptionServiceBase : OptionService {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
ToggleOption(OptionConstants.experimentalapiName, OptionConstants.experimentalapiAlias, false),
|
ToggleOption(OptionConstants.experimentalapiName, OptionConstants.experimentalapiAlias, false)
|
||||||
ToggleOption("closenotebooks", "closenotebooks", true),
|
|
||||||
)
|
)
|
||||||
private val globalValues = mutableMapOf<String, VimDataType>()
|
private val globalValues = mutableMapOf<String, VimDataType>()
|
||||||
|
|
||||||
|
@ -35,18 +35,6 @@ import com.maddyhome.idea.vim.vimscript.model.ExecutionResult
|
|||||||
data class CmdCommand(val ranges: Ranges, val argument: String) : Command.SingleExecution(ranges) {
|
data class CmdCommand(val ranges: Ranges, val argument: String) : Command.SingleExecution(ranges) {
|
||||||
override val argFlags = flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY)
|
override val argFlags = flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY)
|
||||||
|
|
||||||
private val unsupportedArgs = listOf(
|
|
||||||
Regex("-range(=[^ ])?") to "-range",
|
|
||||||
Regex("-complete=[^ ]*") to "-complete",
|
|
||||||
Regex("-count=[^ ]*") to "-count",
|
|
||||||
Regex("-addr=[^ ]*") to "-addr",
|
|
||||||
Regex("-bang") to "-bang",
|
|
||||||
Regex("-bar") to "-bar",
|
|
||||||
Regex("-register") to "-register",
|
|
||||||
Regex("-buffer") to "-buffer",
|
|
||||||
Regex("-keepscript") to "-keepscript",
|
|
||||||
)
|
|
||||||
|
|
||||||
// Static definitions needed for aliases.
|
// Static definitions needed for aliases.
|
||||||
private companion object {
|
private companion object {
|
||||||
const val overridePrefix = "!"
|
const val overridePrefix = "!"
|
||||||
@ -88,14 +76,6 @@ data class CmdCommand(val ranges: Ranges, val argument: String) : Command.Single
|
|||||||
argument = argument.removePrefix(overridePrefix).trim()
|
argument = argument.removePrefix(overridePrefix).trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
for ((arg, message) in unsupportedArgs) {
|
|
||||||
val match = arg.find(argument)
|
|
||||||
match?.range?.let {
|
|
||||||
argument = argument.removeRange(it)
|
|
||||||
injector.messages.showStatusBarMessage("'$message' is not supported by `command`")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle alias arguments
|
// Handle alias arguments
|
||||||
val hasArguments = argument.startsWith(argsPrefix)
|
val hasArguments = argument.startsWith(argsPrefix)
|
||||||
var minNumberOfArgs = 0
|
var minNumberOfArgs = 0
|
||||||
|
@ -30,6 +30,7 @@ data class Register(val char: Char) : Expression() {
|
|||||||
|
|
||||||
override fun evaluate(editor: VimEditor, context: ExecutionContext, vimContext: VimLContext): VimDataType {
|
override fun evaluate(editor: VimEditor, context: ExecutionContext, vimContext: VimLContext): VimDataType {
|
||||||
val register = injector.registerGroup.getRegister(char) ?: throw ExException("Register is not supported yet")
|
val register = injector.registerGroup.getRegister(char) ?: throw ExException("Register is not supported yet")
|
||||||
return VimString(injector.parser.toPrintableString(register.keys))
|
// todo Esc like keys should be one char
|
||||||
|
return VimString(injector.parser.toKeyNotation(register.keys))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,6 @@ interface VariableService {
|
|||||||
*/
|
*/
|
||||||
fun unlockVariable(variable: Variable, depth: Int, editor: VimEditor, context: ExecutionContext, vimContext: VimLContext)
|
fun unlockVariable(variable: Variable, depth: Int, editor: VimEditor, context: ExecutionContext, vimContext: VimLContext)
|
||||||
|
|
||||||
fun getGlobalVariables(): Map<String, VimDataType>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all global variables
|
* Clears all global variables
|
||||||
*/
|
*/
|
||||||
|
@ -71,10 +71,6 @@ abstract class VimVariableServiceBase : VariableService {
|
|||||||
value.unlockVar(depth)
|
value.unlockVar(depth)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getGlobalVariables(): Map<String, VimDataType> {
|
|
||||||
return globalVariables
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun storeVariable(variable: Variable, value: VimDataType, editor: VimEditor, context: ExecutionContext, vimContext: VimLContext) {
|
override fun storeVariable(variable: Variable, value: VimDataType, editor: VimEditor, context: ExecutionContext, vimContext: VimLContext) {
|
||||||
val scope = variable.scope ?: getDefaultVariableScope(vimContext)
|
val scope = variable.scope ?: getDefaultVariableScope(vimContext)
|
||||||
val name = variable.name.evaluate(editor, context, vimContext).value
|
val name = variable.name.evaluate(editor, context, vimContext).value
|
||||||
|
Loading…
Reference in New Issue
Block a user