emacs-diffs
[Top][All Lists]
Advanced

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

master 1ee9275c1b: Avoid scrolling display when point moves into invisib


From: Eli Zaretskii
Subject: master 1ee9275c1b: Avoid scrolling display when point moves into invisible text
Date: Thu, 13 Jan 2022 08:41:21 -0500 (EST)

branch: master
commit 1ee9275c1bb3fe7754188931d38c5b4404d5419f
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Avoid scrolling display when point moves into invisible text
    
    * src/xdisp.c (try_cursor_movement): Handle point moving into
    invisible text.  (Bug#53215)
---
 src/xdisp.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/xdisp.c b/src/xdisp.c
index 2326df4300..977d31703f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18557,6 +18557,20 @@ try_cursor_movement (Lisp_Object window, struct 
text_pos startp,
                            || (NILP (g->object)
                                && (g->charpos == PT
                                    || (g->charpos == 0 && endpos - 1 == PT)));
+                         /* Perhaps the point position is inside
+                            invisible text?  In that case, we trust
+                            'set_cursor_from_row' to do its job and
+                            find the best position for the cursor.  */
+                         if (!exact_match_p)
+                           {
+                             Lisp_Object val =
+                               get_char_property_and_overlay (make_fixnum (PT),
+                                                              Qinvisible,
+                                                              Qnil, NULL);
+
+                             if (TEXT_PROP_MEANS_INVISIBLE (val) != 0)
+                               exact_match_p = true;
+                           }
                        }
                      if (at_zv_p || exact_match_p)
                        {



reply via email to

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