nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH 2/2] wrapping: compare persistent line numbers inste


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH 2/2] wrapping: compare persistent line numbers instead of volatile pointers
Date: Sat, 2 Dec 2017 20:06:55 +0100

This fully fixes https://savannah.gnu.org/bugs/?52576.
---
 src/nano.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/nano.c b/src/nano.c
index 2eb7105a..903ed52a 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1679,6 +1679,9 @@ int do_input(bool allow_funcs)
        } else
 #endif
        {
+#ifdef ENABLE_WRAPPING
+           size_t was_lineno = openfile->current->lineno;
+#endif
 #ifndef NANO_TINY
            filestruct *was_current = openfile->current;
            size_t was_x = openfile->current_x;
@@ -1704,7 +1707,7 @@ int do_input(bool allow_funcs)
 #endif
 #ifdef ENABLE_WRAPPING
            /* If the cursor moved to another line, clear the prepend flag. */
-           if (openfile->current != was_current)
+           if (openfile->current->lineno != was_lineno)
                wrap_reset();
 #endif
 #ifdef ENABLE_COLOR
-- 
2.14.3




reply via email to

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