commit e8a5665d2cb2975e95c59ed9e902b919320756a6
parent 65e4784eec62e49d253bb6ff8b441dc298bc9519
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Fri, 14 Sep 2018 21:57:24 +0200
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.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -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