- nano.c:
renumber()
- Remove invalid assert. (DLR, found by Filipe Moreira)
- do_input()
- - If we get NANO_CONTROL_8, handle it instead of ignoring it,
- for consistency. (DLR)
- nano.h:
- Reorder the toggle #defines to match their corresponding order
in toggle_init(). (DLR)
- prompt.c:
- do_statusbar_input()
- - If we get NANO_CONTROL_8, handle it instead of ignoring it,
- for consistency. (DLR)
get_prompt_string()
- Include the handling of the help key even when help is
disabled, so that we aren't erroneously kicked out of the
- Change all rcfile error messages to refer to commands instead
of directives, for consistency with nanorc.5. (DLR)
- winio.c:
+ parse_kbinput()
+ - If we get NANO_CONTROL_8, properly handle it in all cases.
+ (DLR)
get_control_kbinput()
- Add Ctrl-/ as an alias for Ctrl-_. (DLR, found by Benno
Schulenberg)
/* Read in a character. */
input = get_kbinput(edit, meta_key, func_key);
- if (allow_funcs) {
#ifndef DISABLE_MOUSE
- /* If we got a mouse click and it was on a shortcut, read in the
- * shortcut character. */
- if (*func_key == TRUE && input == KEY_MOUSE)
- input = do_mouse() ? get_kbinput(edit, meta_key, func_key) :
+ if (allow_funcs) {
+ /* If we got a mouse click and it was on a shortcut, read in the
+ * shortcut character. */
+ if (allow_funcs && *func_key == TRUE && input == KEY_MOUSE)
+ input = do_mouse() ? get_kbinput(edit, meta_key, func_key) :
ERR;
- else
+}
#endif
- if (input == NANO_CONTROL_8 && *meta_key == FALSE &&
- *func_key == FALSE)
- input = ISSET(REBIND_DELETE) ? NANO_BACKSPACE_KEY :
- NANO_DELETE_KEY;
- }
/* Check for a shortcut in the main list. */
s = get_shortcut(main_list, &input, meta_key, func_key);
/* Read in a character. */
input = get_kbinput(bottomwin, meta_key, func_key);
- if (allow_funcs) {
#ifndef DISABLE_MOUSE
- /* If we got a mouse click and it was on a shortcut, read in the
- * shortcut character. */
- if (*func_key == TRUE && input == KEY_MOUSE)
- input = do_statusbar_mouse() ? get_kbinput(bottomwin,
- meta_key, func_key) : ERR;
- else
+ if (allow_funcs) {
+ /* If we got a mouse click and it was on a shortcut, read in the
+ * shortcut character. */
+ if (allow_funcs && *func_key == TRUE && input == KEY_MOUSE)
+ input = do_statusbar_mouse() ? get_kbinput(bottomwin, meta_key,
+ func_key) : ERR;
+}
#endif
- if (input == NANO_CONTROL_8 && *meta_key == FALSE &&
- *func_key == FALSE)
- input = ISSET(REBIND_DELETE) ? NANO_BACKSPACE_KEY :
- NANO_DELETE_KEY;
- }
/* Check for a shortcut in the current list. */
s = get_shortcut(currshortcut, &input, meta_key, func_key);
switch (escapes) {
case 0:
switch (*kbinput) {
- case NANO_CONTROL_8:
- retval = ISSET(REBIND_DELETE) ?
- NANO_DELETE_KEY : NANO_BACKSPACE_KEY;
- break;
case KEY_DOWN:
retval = NANO_NEXTLINE_KEY;
break;
}
}
- /* If we have a result and it's an extended keypad value (i.e, a
- * value outside of byte range), set func_key to TRUE. */
- if (retval != ERR)
+ if (retval != ERR) {
+ /* If our result is NANO_CONTROL_8, translate it to either
+ * Backspace or Delete, depending on whether REBIND_DELETE is
+ * TRUE or FALSE. */
+ if (retval == NANO_CONTROL_8)
+ retval = ISSET(REBIND_DELETE) ? NANO_BACKSPACE_KEY :
+ NANO_DELETE_KEY;
+
+ /* If our result is an extended keypad value (i.e, a value
+ * outside of byte range), set func_key to TRUE. */
*func_key = !is_byte(retval);
+ }
#ifdef DEBUG
fprintf(stderr, "parse_kbinput(): kbinput = %d, meta_key = %d, func_key = %d, escapes = %d, byte_digits = %d, retval = %d\n", *kbinput, (int)*meta_key, (int)*func_key, escapes, byte_digits, retval);