bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22637: 25.1.50; `mode-line` face `:height` incompatible with `scroll


From: Keith David Bershatsky
Subject: bug#22637: 25.1.50; `mode-line` face `:height` incompatible with `scroll-conservatively 101`.
Date: Sat, 13 Feb 2016 19:40:34 -0800

In addition to the fix that you implemented yesterday near the section of 
"optimization 3", another similar fix would be needed near the following 
"recenter" section that affects cursor visibility when using isearch where 
sometimes point is below the bottom of the screen and remains there subsequent 
to redisplay.  I have not yet been able to figure out how to use 
`cursor_row_fully_visible_p`, so I used something a little easier for me to 
understand that basically tests the same thing (I think).

If I can come up with a small test that demonstrates the problem when 
searching, I'll send over an example.  The following code, however, does seem 
to fix the problem in all of my tests.


      /* 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 window_total_lines
            = WINDOW_TOTAL_LINES (w) * FRAME_LINE_HEIGHT (f) * 
frame_line_height;
          int margin =
            scroll_margin > 0
            ? min (scroll_margin, window_total_lines / 4)
            : 0;
          bool move_down = w->cursor.vpos >= window_total_lines / 2;

          move_it_by_lines (&it, move_down ? margin + 1 : -(margin + 1));
          clear_glyph_matrix (w->desired_matrix);

  /* Added a check/fix for a problem similar/same as bug #22637.  */
  if (1 == try_window (window, it.current.pos, TRY_WINDOW_CHECK_MARGINS))
    {
      bool fully_p = false;
      EMACS_INT posint = PT;
      struct buffer *buf;
      int x, y, rtop, rbot, rowh, vpos;
      buf = XBUFFER (w->contents);
      if ((posint >= CHARPOS (startp) && posint <= BUF_ZV (buf))
          && CHARPOS (startp) >= BUF_BEGV (buf)
          && CHARPOS (startp) <= BUF_ZV (buf)
          && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos))
        fully_p = !rtop && !rbot;
      if (!fully_p)
        {
#ifdef GLYPH_DEBUG
          debug_method_add (w, "!fully_p -- goto try_to_scroll");
#endif
          goto try_to_scroll;
        }
        else
          {
#ifdef GLYPH_DEBUG
            debug_method_add (w, "fully_p -- goto done");
#endif
            goto done;
          }
    }

        }





reply via email to

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