From e8a5665d2cb2975e95c59ed9e902b919320756a6 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 14 Sep 2018 21:57:24 +0200 Subject: [PATCH] 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 ) delete the word to the left of the cursor while continues to delete just one character. --- src/global.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/global.c b/src/global.c index ae92dcff..2543970a 100644 --- 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