File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,7 +210,11 @@ local function set_setting(args)
210210 -- here just in case, is already checked in the loop above
211211 qerror (' missing value for ' .. path )
212212 elseif entry_type == ' boolean' then
213- value = argparse .boolean (value , path )
213+ if value == ' toggle' then
214+ value = not cfg [key ]
215+ else
216+ value = argparse .boolean (value , path )
217+ end
214218 elseif entry_type == ' number' then
215219 if path == ' follow-seconds' then
216220 value = argparse .positiveInt (value , path )
@@ -241,7 +245,12 @@ function parse_commandline(args)
241245 if not command or command == ' status' then
242246 print_status ()
243247 elseif command == ' toggle' then
244- do_toggle ()
248+ if # args == 0 then
249+ do_toggle ()
250+ else
251+ args [# args + 1 ] = ' toggle'
252+ set_setting (args )
253+ end
245254 elseif command == ' set' then
246255 set_setting (args )
247256 elseif command == ' overlay' then
You can’t perform that action at this time.
0 commit comments