nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH 1/2] wrapping: keep prepending to the same next line


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH 1/2] wrapping: keep prepending to the same next line as long as possible
Date: Sat, 2 Dec 2017 20:06:54 +0100

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 2076915c..2eb7105a 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);
-- 
2.14.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]