We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
enable_all
disable_all
1 parent 39b676e commit e0a22a4Copy full SHA for e0a22a4
lua/reactive/commands.lua
@@ -158,14 +158,16 @@ function M:init()
158
return
159
end
160
161
- if not val then
+ local is_preset_required = cmd == 'enable' or cmd == 'disable' or cmd == 'toggle'
162
+
163
+ if not val and is_preset_required then
164
vim.notify('reactive.nvim: specify a preset name', vim.log.levels.ERROR)
165
166
167
168
if not self.commands[cmd] then
169
vim.notify('reactive.nvim: There\'s no such a command: ' .. cmd, vim.log.levels.ERROR)
- elseif not require('reactive.state').presets[val] then
170
+ elseif is_preset_required and not require('reactive.state').presets[val] then
171
vim.notify('reactive.nvim: There\'s no such a preset: ' .. val, vim.log.levels.ERROR)
172
else
173
self.commands[cmd](val)
0 commit comments