mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-12 18:34:06 +02:00
Fix set command
This commit is contained in:
parent
d6ca75006a
commit
ca934fe514
src
main/java/com/maddyhome/idea/vim/vimscript/model/commands
test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands
@ -143,6 +143,8 @@ fun parseOptionLine(editor: Editor, args: String, scope: OptionService.Scope, fa
|
||||
if (eq == -1) {
|
||||
if (optionService.isToggleOption(token)) {
|
||||
optionService.setOption(scope, token, token)
|
||||
} else if (!optionService.getOptions().contains(token)) {
|
||||
error = Msg.unkopt
|
||||
} else {
|
||||
toShow.add(Pair(token, token))
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
* Copyright (C) 2003-2021 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.commands
|
||||
|
||||
import org.jetbrains.plugins.ideavim.VimTestCase
|
||||
|
||||
class SetCommandTest : VimTestCase() {
|
||||
|
||||
fun `test unknown option`() {
|
||||
configureByText("\n")
|
||||
typeText(commandToKeys("set unknownOption"))
|
||||
assertPluginError(true)
|
||||
assertPluginErrorMessageContains("Unknown option: unknownOption")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user