diff --git a/.idea/misc.xml b/.idea/misc.xml index 85481e68af..193074bf8a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -18,5 +18,5 @@ - + \ No newline at end of file diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt index 3aca4e0607..2aebb0bd8c 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/FirstCommandTest.kt @@ -20,4 +20,28 @@ class FirstCommandTest : VimTestCase() { val command = injector.vimscriptParser.parseCommand("first") assertTrue(command is SelectFirstFileCommand) } + + @Test + fun `command parsing bfirst`() { + val command = injector.vimscriptParser.parseCommand("bfirst") + assertTrue(command is SelectFirstFileCommand) + } + + @Test + fun `command parsing bf`() { + val command = injector.vimscriptParser.parseCommand("bf") + assertTrue(command is SelectFirstFileCommand) + } + + @Test + fun `command parsing brewind`() { + val command = injector.vimscriptParser.parseCommand("brewind") + assertTrue(command is SelectFirstFileCommand) + } + + @Test + fun `command parsing br`() { + val command = injector.vimscriptParser.parseCommand("br") + assertTrue(command is SelectFirstFileCommand) + } } \ No newline at end of file diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt index 4ffa7e43ec..1c3dcf7743 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/LastCommandTest.kt @@ -20,4 +20,16 @@ class LastCommandTest : VimTestCase() { val command = injector.vimscriptParser.parseCommand("last") assertTrue(command is SelectLastFileCommand) } + + @Test + fun `command parsing blast`() { + val command = injector.vimscriptParser.parseCommand("blast") + assertTrue(command is SelectLastFileCommand) + } + + @Test + fun `command parsing bl`() { + val command = injector.vimscriptParser.parseCommand("bl") + assertTrue(command is SelectLastFileCommand) + } } \ No newline at end of file diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt index c08aaa237c..18f6ab86a3 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/NextFileCommandTest.kt @@ -20,4 +20,16 @@ class NextFileCommandTest : VimTestCase() { val command = injector.vimscriptParser.parseCommand("next") assertTrue(command is NextFileCommand) } + + @Test + fun `command parsing bnext`() { + val command = injector.vimscriptParser.parseCommand("bnext") + assertTrue(command is NextFileCommand) + } + + @Test + fun `command parsing bn`() { + val command = injector.vimscriptParser.parseCommand("bn") + assertTrue(command is NextFileCommand) + } } \ No newline at end of file diff --git a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt index 5defab13fe..7f2575f1da 100644 --- a/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt +++ b/src/test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands/PreviousFileCommandTest.kt @@ -22,4 +22,16 @@ class PreviousFileCommandTest : VimTestCase() { assertTrue(command is PreviousFileCommand) assertEquals("4", command.argument) } + + @Test + fun `command parsing bprevious`() { + val command = injector.vimscriptParser.parseCommand("bprevious") + assertTrue(command is PreviousFileCommand) + } + + @Test + fun `command parsing bp`() { + val command = injector.vimscriptParser.parseCommand("bp") + assertTrue(command is PreviousFileCommand) + } } \ No newline at end of file diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/SelectFirstFileCommand.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/BfirstCommand.kt similarity index 81% rename from vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/SelectFirstFileCommand.kt rename to vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/BfirstCommand.kt index 8a45b3998c..c0e98ea96b 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/SelectFirstFileCommand.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/BfirstCommand.kt @@ -17,14 +17,14 @@ import com.maddyhome.idea.vim.ex.ranges.Range import com.maddyhome.idea.vim.vimscript.model.ExecutionResult /** - * see "h :first" + * see "h :bfirst" */ -@ExCommand(command = "fir[st]") -data class SelectFirstFileCommand(val range: Range, val modifier: CommandModifier, val argument: String) : +@ExCommand(command = "bf[irst],br[ewind]") +data class BfirstCommand(val range: Range, val modifier: CommandModifier, val argument: String) : Command.SingleExecution(range, modifier, argument) { override val argFlags: CommandHandlerFlags = - flags(RangeFlag.RANGE_OPTIONAL, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY) + flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_FORBIDDEN, Access.READ_ONLY) override fun processCommand( editor: VimEditor, diff --git a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/SelectLastFileCommand.kt b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/BlastCommand.kt similarity index 81% rename from vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/SelectLastFileCommand.kt rename to vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/BlastCommand.kt index 727fdcde6d..a5ac956413 100644 --- a/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/SelectLastFileCommand.kt +++ b/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/commands/BlastCommand.kt @@ -17,14 +17,14 @@ import com.maddyhome.idea.vim.ex.ranges.Range import com.maddyhome.idea.vim.vimscript.model.ExecutionResult /** - * see "h :last" + * see "h :blast" */ -@ExCommand(command = "la[st]") -data class SelectLastFileCommand(val range: Range, val modifier: CommandModifier, val argument: String) : +@ExCommand(command = "bl[ast]") +data class BlastCommand(val range: Range, val modifier: CommandModifier, val argument: String) : Command.SingleExecution(range, modifier, argument) { override val argFlags: CommandHandlerFlags = - flags(RangeFlag.RANGE_OPTIONAL, ArgumentFlag.ARGUMENT_OPTIONAL, Access.READ_ONLY) + flags(RangeFlag.RANGE_FORBIDDEN, ArgumentFlag.ARGUMENT_FORBIDDEN, Access.READ_ONLY) override fun processCommand( editor: VimEditor,