1
0
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:
lippfi 2021-11-18 07:18:44 +03:00
parent d6ca75006a
commit ca934fe514
2 changed files with 33 additions and 0 deletions
src
main/java/com/maddyhome/idea/vim/vimscript/model/commands
test/java/org/jetbrains/plugins/ideavim/ex/implementation/commands

View File

@ -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))
}

View File

@ -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")
}
}