tweaks: move some debugging stuff, and move modified editing keys too
Again, just for preapring an easier return from the parsing routine.
Этот коммит содержится в:
родитель
cb10b2b908
Коммит
b9e83fe9f8
37
src/winio.c
37
src/winio.c
@ -315,6 +315,22 @@ int get_kbinput(WINDOW *win)
|
||||
while ((kbinput = parse_kbinput(win)) == ERR)
|
||||
;
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "after parsing: kbinput = %d, meta_key = %s\n",
|
||||
kbinput, meta_key ? "TRUE" : "FALSE");
|
||||
#endif
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (kbinput == controlleft)
|
||||
kbinput = sc_seq_or(do_prev_word_void, 0);
|
||||
else if (kbinput == controlright)
|
||||
kbinput = sc_seq_or(do_next_word_void, 0);
|
||||
else if (kbinput == controlup)
|
||||
kbinput = sc_seq_or(do_prev_block, 0);
|
||||
else if (kbinput == controldown)
|
||||
kbinput = sc_seq_or(do_next_block, 0);
|
||||
#endif
|
||||
|
||||
/* If we read from the edit window, blank the statusbar if needed. */
|
||||
if (win == edit)
|
||||
check_statusblank();
|
||||
@ -348,6 +364,11 @@ int parse_kbinput(WINDOW *win)
|
||||
keycode = *kbinput;
|
||||
free(kbinput);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "before parsing: keycode = %d, escapes = %d, byte_digits = %d\n",
|
||||
keycode, escapes, byte_digits);
|
||||
#endif
|
||||
|
||||
if (keycode == NANO_CONTROL_3) {
|
||||
/* Increment the escape counter. */
|
||||
escapes++;
|
||||
@ -620,24 +641,8 @@ int parse_kbinput(WINDOW *win)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (retval == controlleft)
|
||||
retval = sc_seq_or(do_prev_word_void, 0);
|
||||
else if (retval == controlright)
|
||||
retval = sc_seq_or(do_next_word_void, 0);
|
||||
else if (retval == controlup)
|
||||
retval = sc_seq_or(do_prev_block, 0);
|
||||
else if (retval == controldown)
|
||||
retval = sc_seq_or(do_next_block, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "parse_kbinput(): kbinput = %d, meta_key = %s, escapes = %d, byte_digits = %d, retval = %d\n",
|
||||
keycode, meta_key ? "TRUE" : "FALSE", escapes, byte_digits, retval);
|
||||
#endif
|
||||
|
||||
/* Return the result. */
|
||||
return retval;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user