I have the SPACE key bound to toggling the viewer pane on/off and between vert/horiz mode.
Now I’d also like to use SPACE for toggling checkboxes when in checkbox mode.
I tried to implement that with the following button:
@toggle:if Set VIEWPANE=On
@if:Set CHECKBOXMODE=On
Select TOGGLECHECKS
@if:Set VIEWPANE=Off CHECKBOXMODE=Off
Set VIEWPANE=On,Vert
@if:Set VIEWPANE=On,Vert CHECKBOXMODE=Off
Set VIEWPANE=On,Horiz
@if:Set VIEWPANE=On,Horiz CHECKBOXMODE=Off
Set VIEWPANE=Off
Result
With checkbox mode turned on, this works as expected. However, when checkbox mode is off, the viewer pane just flickers between vert/horiz and then disappears when pressing SPACE.
Question
The docs on SET indicate that SET can be used with multiple options, such as Set DUAL=on TREE=off. I wonder whether the @if:Set command modifier is also meant to work with multiple options, such as @if:Set VIEWPANE=On,Vert CHECKBOXMODE=Off? If so, why doesn’t the above script work as expected?
The docs on @if:Set do not list an example using ; and the docs on SET outline a different syntax, namely Set DUAL=on TREE=off. This could be improved.
For the record, here’s the updated button code that works as expected:
@toggle:if Set VIEWPANE=On
@if:Set CHECKBOXMODE=On; Set VIEWPANE=Off
Select TOGGLECHECKS
@if:Set CHECKBOXMODE=Off; Set VIEWPANE=Off
Set VIEWPANE=On,Vert
@if:Set CHECKBOXMODE=Off; Set VIEWPANE=On,Vert
Set VIEWPANE=On,Horiz
@if:Set CHECKBOXMODE=Off; Set VIEWPANE=On,Horiz
Set VIEWPANE=Off