-
Is there any way to toggle case in selection (upper/lower)? I would like also to assign a single keystroke to that. Many thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
You mean a single shortcut to toggle the current state? Otherwise there is this:
|
Beta Was this translation helpful? Give feedback.
-
@rgieseke, this works fine: keys['ctrl+alt+u'] = function()
if Upper_Case then
buffer.lower_case()
Upper_Case = false
else
buffer.upper_case()
Upper_Case = true
end
end I realized I was modifying a backup It seems that for Lua if x is nil, x is both not true and not false. if UpperCase then print("yes") else print("no") end
if UpperCase == true then print("yes") else print("no") end
if UpperCase == false then print("yes") else print("no") end
if not UpperCase then print("yes") else print("no") end The first three conditionals print no, the fourth one prints yes. This did the trick here. |
Beta Was this translation helpful? Give feedback.
@rgieseke, this works fine:
I realized I was modifying a backup
init.lua
(so my approach couldn’t work at all 😅).It seems that for Lua if x is nil, x is both not true and not false.
The first three conditionals print no, the fourth one prints yes.
This did the trick here.