nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a2f8703df5a9cf7b13416c250f329a87436e0feb
parent 073251fdb19a700096ab90d4aabb99c4fe277df9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 31 Jan 2020 16:05:51 +0100

tweaks: tumble three conditions, for consistency in comparisons

Diffstat:
Msrc/nano.c | 2+-
Msrc/winio.c | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1476,7 +1476,7 @@ void suck_up_input_and_paste_it(void) line = line->next; line->data = copy_of(""); index = 0; - } else if ((input >= 0x20 && input <= 0xFF && input != DEL_CODE) || + } else if ((0x20 <= input && input <= 0xFF && input != DEL_CODE) || input == TAB_CODE) { line->data = charealloc(line->data, index + 2); line->data[index++] = (char)input; diff --git a/src/winio.c b/src/winio.c @@ -934,7 +934,7 @@ int parse_kbinput(WINDOW *win) key_buffer_len == 0 || *key_buffer == ESC_CODE) { /* One escape followed by a single non-escape: * meta key sequence mode. */ - if (!solitary || (keycode >= 0x20 && keycode < 0x7F)) + if (!solitary || (0x20 <= keycode && keycode <= 0x7E)) meta_key = TRUE; retval = (shifted_metas) ? keycode : tolower(keycode); } else @@ -3091,7 +3091,7 @@ size_t get_chunk_and_edge(size_t column, linestruct *line, size_t *leftedge) end_col = get_softwrap_breakpoint(line->data, start_col, &end_of_line); /* We reached the end of the line and/or found column, so get out. */ - if (end_of_line || (column >= start_col && column < end_col)) { + if (end_of_line || (start_col <= column && column < end_col)) { if (leftedge != NULL) *leftedge = start_col; return current_chunk;