emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master dbffbe0: Fix 'end-of-visual-line' with overlay stri


From: Eli Zaretskii
Subject: [Emacs-diffs] master dbffbe0: Fix 'end-of-visual-line' with overlay strings with newlines
Date: Sat, 2 Mar 2019 05:19:22 -0500 (EST)

branch: master
commit dbffbe08815644fd30404891ef81496277ed27da
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix 'end-of-visual-line' with overlay strings with newlines
    
    * src/indent.c (Fvertical_motion): Get out of overlay strings
    with embedded newlines even if moving within the same screen
    line.  See https://github.com/emacs-lsp/lsp-mode/issues/677
    for more details.
    Fix test for IT_CHARPOS being at the beginning of the
    accessible portion of the buffer.
---
 src/indent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/indent.c b/src/indent.c
index bc1aa8c..1d5d346 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2286,7 +2286,7 @@ whether or not it is currently displayed in some window.  
*/)
          it.current_y = 0;
          /* Do this even if LINES is 0, so that we move back to the
             beginning of the current line as we ought.  */
-         if ((nlines < 0 && IT_CHARPOS (it) > 0)
+         if ((nlines < 0 && IT_CHARPOS (it) > BEGV)
              || (nlines == 0 && !(start_x_given && start_x <= to_x)))
            move_it_by_lines (&it, max (PTRDIFF_MIN, nlines));
        }
@@ -2338,7 +2338,7 @@ whether or not it is currently displayed in some window.  
*/)
             and then reposition point at the requested X coordinate;
             if we don't, the cursor will be placed just after the
             string, which might not be the requested column.  */
-         if (nlines > 0 && it.area == TEXT_AREA)
+         if (nlines >= 0 && it.area == TEXT_AREA)
            {
              while (it.method == GET_FROM_STRING
                     && !it.string_from_display_prop_p



reply via email to

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