]> Sergey Matveev's repositories - nnn.git/commitdiff
Also treat ^H as backspace
authorlostd <lostd@2f30.org>
Tue, 27 Jan 2015 11:29:12 +0000 (13:29 +0200)
committerlostd <lostd@2f30.org>
Tue, 27 Jan 2015 11:29:12 +0000 (13:29 +0200)
config.def.h
noice.c

index 4c7ade3e59394be05c3a9b9a6fee6509a70550c2..996436f321be4cffe4fe82201d06629c1e05facb 100644 (file)
@@ -18,6 +18,7 @@ struct key bindings[] = {
        { KEY_BACKSPACE,  SEL_BACK },
        { KEY_LEFT,       SEL_BACK },
        { 'h',            SEL_BACK },
+       { CONTROL('H'),   SEL_BACK },
        /* Inside */
        { KEY_ENTER,      SEL_GOIN },
        { '\r',           SEL_GOIN },
diff --git a/noice.c b/noice.c
index e841efa9504b42e46f032cb563e58a81aecc5640..af9a34d67db0dca096960e5d22a391d867c0bcc7 100644 (file)
--- a/noice.c
+++ b/noice.c
@@ -327,7 +327,7 @@ readln(void)
        while ((c = getch()) != ERR) {
                if (c == KEY_ENTER || c == '\r')
                        break;
-               if (c == KEY_BACKSPACE) {
+               if (c == KEY_BACKSPACE || c == CONTROL('H')) {
                        getyx(stdscr, y, x);
                        if (x >= x0) {
                                i--;
@@ -386,7 +386,7 @@ readmore(char **str)
                ret = 1;
                goto out;
        }
-       if (c == KEY_BACKSPACE) {
+       if (c == KEY_BACKSPACE || c == CONTROL('H')) {
                i--;
                if (i > 0) {
                        ln = xrealloc(ln, (i + 1) * sizeof(*ln));