Code

screen_find.c: fix backspace bug
authormatt <matt.r.portas@gmail.com>
Sat, 2 Apr 2011 17:11:25 +0000 (18:11 +0100)
committerMax Kellermann <max@duempel.org>
Thu, 23 Jun 2011 06:37:16 +0000 (08:37 +0200)
Use ncurses macros instead of magic numbers.

src/screen_find.c

index c17db4d3354652743af1f6f13234af1a7c62d707..890f58cf14579dcf0436ec8012fa7f41437488e0 100644 (file)
@@ -114,7 +114,7 @@ screen_jump(struct list_window *lw,
        while(1) {
                key = screen_getch(screen.findbuf);
                /* if backspace or delete was pressed, process instead of ending loop */
-               if (key == 127 || key == 330) {
+               if (key == KEY_BACKSPACE || key == KEY_DC) {
                        int i;
                        if (search_str <= g_utf8_find_prev_char(screen.findbuf, iter))
                                iter = g_utf8_find_prev_char(screen.findbuf, iter);