aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--toggler.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/toggler.lua b/toggler.lua
index 4b643af..333a217 100644
--- a/toggler.lua
+++ b/toggler.lua
@@ -47,7 +47,7 @@ local function case(str)
end)
end
-local function operator_new(key, handler, object, motion, help)
+local function operator_new(key, handler, object, motion, help, novisual)
local id = vis:operator_register(handler)
if id < 0 then
return false
@@ -65,7 +65,9 @@ local function operator_new(key, handler, object, motion, help)
end
end
vis:map(vis.modes.NORMAL, key, binding, help)
- vis:map(vis.modes.VISUAL, key, binding, help)
+ if not novisual then
+ vis:map(vis.modes.VISUAL, key, binding, help)
+ end
end
local function preprocess(tbl)
@@ -79,8 +81,8 @@ local function preprocess(tbl)
end
vis.events.subscribe(vis.events.INIT, function()
- operator_new("<C-a>", toggle(increment), inner_word, nil, "Toggle/increment word or selection")
- operator_new("<C-x>", toggle(decrement), inner_word, nil, "Toggle/decrement word or selection")
+ operator_new("<C-a>", toggle(increment), inner_word, nil, "Toggle/increment word or selection", true)
+ operator_new("<C-x>", toggle(decrement), inner_word, nil, "Toggle/decrement word or selection", true)
operator_new("~", toggle(case, true), nil, char_next, "Toggle case of character or selection")
operator_new("g~", toggle(case), nil, nil, "Toggle-case operator")
operator_new("gu", toggle(string.lower), nil, nil, "Lower-case operator")