emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r106511: Fix bug #10105 with Isearch


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106511: Fix bug #10105 with Isearch triggered scrolling under scroll-conservatively.
Date: Fri, 25 Nov 2011 13:32:14 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106511
fixes bug(s): http://debbugs.gnu.org/10105
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Fri 2011-11-25 13:32:14 +0200
message:
  Fix bug #10105 with Isearch triggered scrolling under scroll-conservatively.
  
   src/xdisp.c (redisplay_window): If cursor row is not fully visible
   after recentering, and scroll-conservatively is set to a large
   number, scroll window by a few more lines to make the cursor fully
   visible and out of scroll-margin.
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-11-24 19:02:39 +0000
+++ b/src/ChangeLog     2011-11-25 11:32:14 +0000
@@ -1,3 +1,10 @@
+2011-11-25  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (redisplay_window): If cursor row is not fully visible
+       after recentering, and scroll-conservatively is set to a large
+       number, scroll window by a few more lines to make the cursor fully
+       visible and out of scroll-margin.  (Bug#10105)
+
 2011-11-24  Juri Linkov  <address@hidden>
 
        * image.c (imagemagick_load_image): Move `MagickSetResolution' down

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2011-11-23 06:47:09 +0000
+++ b/src/xdisp.c       2011-11-25 11:32:14 +0000
@@ -15043,6 +15043,7 @@
   int centering_position = -1;
   int last_line_misfit = 0;
   EMACS_INT beg_unchanged, end_unchanged;
+  int scrolling_up;
 
   SET_TEXT_POS (lpoint, PT, PT_BYTE);
   opoint = lpoint;
@@ -15557,7 +15558,6 @@
        ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4)
        : 0;
       EMACS_INT margin_pos = CHARPOS (startp);
-      int scrolling_up;
       Lisp_Object aggressive;
 
       /* If there is a scroll margin at the top of the window, find
@@ -15720,6 +15720,24 @@
          goto recenter;
        }
 
+      /* Users who set scroll-conservatively to a large number want
+        point just above/below the scroll margin.  If we ended up
+        with point's row partially visible, move the window start to
+        make that row fully visible and out of the margin.  */
+      if (scroll_conservatively > SCROLL_LIMIT)
+       {
+         int margin =
+           scroll_margin > 0
+           ? min (scroll_margin, WINDOW_TOTAL_LINES (w) / 4)
+           : 0;
+
+         move_it_by_lines (&it, scrolling_up ? margin + 1 : margin -1);
+         clear_glyph_matrix (w->desired_matrix);
+         if (1 == try_window (window, it.current.pos,
+                              TRY_WINDOW_CHECK_MARGINS))
+           goto done;
+       }
+
       /* If centering point failed to make the whole line visible,
         put point at the top instead.  That has to make the whole line
         visible, if it can be done.  */


reply via email to

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