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:
Benno Schulenberg 2018-09-14 21:57:24 +02:00
parent 65e4784eec
commit e8a5665d2c

View File

@ -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