emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117347: Fix bug #17905 with display of point in


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117347: Fix bug #17905 with display of point in partially visible line at end of window.
Date: Fri, 04 Jul 2014 13:24:42 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117347
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17905
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Fri 2014-07-04 16:22:04 +0300
message:
  Fix bug #17905 with display of point in partially visible line at end of 
window.
  
   src/xdisp.c (redisplay_window): If redisplay of a window ends up
   with point in a partially visible line at end of the window, make
   sure the amended position of point actually has smaller Y
   coordinate; if not, give up and scroll the display.
   src/window.c (window_scroll_pixel_based): When point ends up at the
   last fully visible line, don't let move_it_to stop at the left
   edge of the line and dupe us into thinking point is inside the
   scroll margin.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/window.c                   window.c-20091113204419-o5vbwnq5f7feedwu-231
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-07-04 07:40:08 +0000
+++ b/src/ChangeLog     2014-07-04 13:22:04 +0000
@@ -1,5 +1,15 @@
 2014-07-04  Eli Zaretskii  <address@hidden>
 
+       * xdisp.c (redisplay_window): If redisplay of a window ends up
+       with point in a partially visible line at end of the window, make
+       sure the amended position of point actually has smaller Y
+       coordinate; if not, give up and scroll the display.  (Bug#17905)
+
+       * window.c (window_scroll_pixel_based): When point ends up at the
+       last fully visible line, don't let move_it_to stop at the left
+       edge of the line and dupe us into thinking point is inside the
+       scroll margin.
+
        * w32.c (network_interface_info): Make sure the argument is a
        Lisp string.
 

=== modified file 'src/window.c'
--- a/src/window.c      2014-04-16 14:00:39 +0000
+++ b/src/window.c      2014-07-04 13:22:04 +0000
@@ -5167,6 +5167,32 @@
       charpos = IT_CHARPOS (it);
       bytepos = IT_BYTEPOS (it);
 
+      /* If PT is in the screen line at the last fully visible line,
+        move_it_to will stop at X = 0 in that line, because the
+        required Y coordinate is reached there.  See if we can get to
+        PT without descending lower in Y, and if we can, it means we
+        reached PT before the scroll margin.  */
+      if (charpos != PT)
+       {
+         struct it it2;
+         void *it_data;
+
+         it2 = it;
+         it_data = bidi_shelve_cache ();
+         move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS);
+         if (IT_CHARPOS (it) == PT && it.current_y == it2.current_y)
+           {
+             charpos = IT_CHARPOS (it);
+             bytepos = IT_BYTEPOS (it);
+             bidi_unshelve_cache (it_data, 1);
+           }
+         else
+           {
+             it = it2;
+             bidi_unshelve_cache (it_data, 0);
+           }
+       }
+
       /* See if point is on a partially visible line at the end.  */
       if (it.what == IT_EOB)
        partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-07-01 17:07:24 +0000
+++ b/src/xdisp.c       2014-07-04 13:22:04 +0000
@@ -16106,6 +16106,18 @@
          /* Point does appear, but on a line partly visible at end of window.
             Move it back to a fully-visible line.  */
          new_vpos = window_box_height (w);
+         /* But if window_box_height suggests a Y coordinate that is
+            not less than we already have, that line will clearly not
+            be fully visible, so give up and scroll the display.
+            This can happen when the default face uses a font whose
+            dimensions are different from the frame's default
+            font.  */
+         if (new_vpos >= w->cursor.y)
+           {
+             w->cursor.vpos = -1;
+             clear_glyph_matrix (w->desired_matrix);
+             goto try_to_scroll;
+           }
        }
       else if (w->cursor.vpos >= 0)
        {


reply via email to

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