From 29f7654ab193661bc14d2bea63c7c1621a2e3a89 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 2 Dec 2017 19:42:32 +0100 Subject: [PATCH] wrapping: keep prepending to the same next line as long as possible Only when the cursor has moved off of the currrent line do we stop prepending wrapped words to the next line. This partially fixes https://savannah.gnu.org/bugs/?52576. --- src/nano.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/nano.c b/src/nano.c index 43797252..5e4bb0d9 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1635,13 +1635,6 @@ int do_input(bool allow_funcs) * all available characters in the input puddle. Note that this * puddle will be empty if we're in view mode. */ if (have_shortcut || get_key_buffer_len() == 0) { -#ifdef ENABLE_WRAPPING - /* If we got a shortcut or toggle, and it's not the shortcut - * for verbatim input, turn off prepending of wrapped text. */ - if (have_shortcut && s->scfunc != do_verbatim_input) - wrap_reset(); -#endif - if (puddle != NULL) { /* Insert all bytes in the input buffer into the edit buffer * at once, filtering out any low control codes. */ @@ -1709,6 +1702,11 @@ int do_input(bool allow_funcs) refresh_needed = TRUE; } #endif +#ifdef ENABLE_WRAPPING + /* If the cursor moved to another line, clear the prepend flag. */ + if (openfile->current != was_current) + wrap_reset(); +#endif #ifdef ENABLE_COLOR if (f && !f->viewok) check_the_multis(openfile->current);