mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 04:41:21 +03:00
bindings: make ^H rebindable also on NetBSD, FreeBSD and macOS
So that the user can do 'bind ^H cutwordleft all' in their nanorc to make ^H (and sometimes also <Ctrl+Backspace>) delete the word to the left of the cursor while <Backspace> continues to delete just one character.
This commit is contained in:
parent
65e4784eec
commit
e8a5665d2c
@ -462,6 +462,10 @@ int keycode_from_string(const char *keystring)
|
||||
if (keystring[0] == '^') {
|
||||
if (strcasecmp(keystring, "^Space") == 0)
|
||||
return 0;
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
|
||||
if (strcasecmp(keystring, "^H") == 0)
|
||||
return KEY_BACKSPACE;
|
||||
#endif
|
||||
if (keystring[1] <= '_' && strlen(keystring) == 2)
|
||||
return keystring[1] - 64;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user