orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
640 stars 38 forks source link

Enhancement suggestion: Change default keyboard shortcut for Upper Case Selection #403

Closed chrisgeli closed 1 year ago

chrisgeli commented 1 year ago

This shortcut is (in the 12.0 alpha 3) ctrl+U which clashes with the default shortcut for Linux Unicode input, which makes the shortcut impossible to use in Textadept (the Unicode input takes precedence), at least on my Debian 12 system running XFCE.

Additional info:

$ find /opt/textadept/ -name '*.lua' -exec grep -Hi 'ctrl+U' {} \;
/opt/textadept/modules/textadept/keys.lua:-- Ctrl+U | ⌘U | ^U | Lower case selection
/opt/textadept/modules/textadept/keys.lua:-- Ctrl+Up | ⌥⇡ | ^Up | Paragraph up
/opt/textadept/modules/textadept/keys.lua:  [m('Edit/Selection/Upper Case Selection')] = {'ctrl+U', 'cmd+U', 'ctrl+meta+u'},
/opt/textadept/modules/textadept/keys.lua:  [m('Edit/Selection/Lower Case Selection')] = {'ctrl+u', 'cmd+u', 'ctrl+u'},
/opt/textadept/modules/textadept/keys.lua:  [buffer.para_up] = {'ctrl+up', 'alt+up', 'ctrl+up'},
/opt/textadept/core/keys.lua:--     keys['ctrl+u'] = function() io.quick_open(_USERHOME) end

Minor aside: The comment in core/keys.lua seems to be outdated.

For now, I mapped it as follows in my ~/.textadept/init.lua:

keys['ctrl+alt+u'] = textadept.menu.menubar[_L.Edit][_L.Selection][_L['Upper Case Selection']][2]

Thanks for your time!

orbitalquark commented 1 year ago

Thanks for the report. I will add an alias, likely either "Ctrl+Alt+U" or "Ctrl+Alt+Shift+U". My Kubuntu 22.04 does not hijack "Ctrl+Shift+U", so I didn't experience the clash.

orbitalquark commented 1 year ago

I've addressed this in https://github.com/orbitalquark/textadept/commit/3111f9ec4f9f8ca8d0f4cbe7f023ab564880f335