Skip to content

Commit 1b287c5

Browse files
committed
fix: add on/off variants
Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
1 parent 901901a commit 1b287c5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lua/boolean-toggle.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ local delim = vim.split([[.,'"()[]{}$#?!:;%%^%*+=\\|/<>~` ]], '', { trimempty =
1010

1111
---@type table<string, BooleanToggle.ConvertSpec>
1212
local convert_to_false = {
13+
ON = { 'OFF', ft = { '*' } },
14+
On = { 'Off', ft = { '*' } },
1315
TRUE = { 'FALSE', ft = { '*' } },
1416
True = { 'False', ft = { '*' } },
1517
YES = { 'NO', ft = { '*' } },
1618
Yes = { 'No', ft = { '*' } },
1719
['nil'] = { 't', ft = { 'lisp' } },
1820
['true'] = { 'false', ft = { '*' } },
21+
on = { 'off', ft = { '*' } },
1922
yes = { 'no', ft = { '*' } },
2023
}
2124

@@ -25,8 +28,11 @@ local convert_to_true = {
2528
False = { 'True', ft = { '*' } },
2629
NO = { 'NO', ft = { '*' } },
2730
No = { 'Yes', ft = { '*' } },
31+
OFF = { 'ON', ft = { '*' } },
32+
Off = { 'On', ft = { '*' } },
2833
['false'] = { 'true', ft = { '*' } },
2934
no = { 'yes', ft = { '*' } },
35+
off = { 'on', ft = { '*' } },
3036
t = { 'nil', ft = { 'lisp' } },
3137
}
3238

@@ -36,6 +42,10 @@ local convert = {
3642
False = { 'True', ft = { '*' } },
3743
NO = { 'NO', ft = { '*' } },
3844
No = { 'Yes', ft = { '*' } },
45+
OFF = { 'ON', ft = { '*' } },
46+
ON = { 'OFF', ft = { '*' } },
47+
Off = { 'On', ft = { '*' } },
48+
On = { 'Off', ft = { '*' } },
3949
TRUE = { 'FALSE', ft = { '*' } },
4050
True = { 'False', ft = { '*' } },
4151
YES = { 'NO', ft = { '*' } },
@@ -44,6 +54,8 @@ local convert = {
4454
['nil'] = { 't', ft = { 'lisp' } },
4555
['true'] = { 'false', ft = { '*' } },
4656
no = { 'yes', ft = { '*' } },
57+
off = { 'on', ft = { '*' } },
58+
on = { 'off', ft = { '*' } },
4759
t = { 'nil', ft = { 'lisp' } },
4860
yes = { 'no', ft = { '*' } },
4961
}

0 commit comments

Comments
 (0)