nano

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

commit 31a2cc9d76b800dcc15d50eaf0ffa077f6f7e8f8
parent 9c6a62d319d8696f12b090a2751af3607e977f66
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  8 Mar 2025 11:01:07 +0100

tweaks: swap two fragments of code, to allow unwrapping a line

Diffstat:
Msrc/nano.c | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -1455,16 +1455,15 @@ void suck_up_input_and_paste_it(void) if (were_waiting == 0 && waiting_keycodes() == 0) bracketed_paste = FALSE; - if (input == '\r' || input == '\n') { + if ((0x20 <= input && input <= 0xFF && input != DEL_CODE) || input == '\t') { + line->data = nrealloc(line->data, index + 2); + line->data[index++] = (char)input; + line->data[index] = '\0'; + } else if (input == '\r' || input == '\n') { line->next = make_new_node(line); line = line->next; line->data = copy_of(""); index = 0; - } else if ((0x20 <= input && input <= 0xFF && input != DEL_CODE) || - input == '\t') { - line->data = nrealloc(line->data, index + 2); - line->data[index++] = (char)input; - line->data[index] = '\0'; } else if (input != BRACKETED_PASTE_MARKER) bracketed_paste = FALSE; }