]> git.eshelyaron.com Git - emacs.git/commitdiff
(hscroll_window_tree): Position cursor near to right margin in hscrolled
authorKim F. Storm <storm@cua.dk>
Sat, 7 Feb 2004 00:00:13 +0000 (00:00 +0000)
committerKim F. Storm <storm@cua.dk>
Sat, 7 Feb 2004 00:00:13 +0000 (00:00 +0000)
window when jumping to end of line (rather than centering cursor).

src/ChangeLog
src/xdisp.c

index 15457e9abffc15f15a1ad602c2a30466681548dd..ad219254ddb86ba21a3987a46b3de43812a8e8e9 100644 (file)
@@ -1,5 +1,9 @@
 2004-02-07  Kim F. Storm  <storm@cua.dk>
 
+       * xdisp.c (hscroll_window_tree): Position cursor near to right
+       margin in hscrolled window when jumping to end of line (rather
+       than centering cursor).
+
        * process.c (wait_reading_process_input): Don't do adaptive read
        buffering if waiting for a specific process.
 
index 3241822e7b495da76e1c301b7c339ef1530815d0..5186a8641c35750fbf1f9f067bec46a84861053f 100644 (file)
@@ -9562,7 +9562,10 @@ hscroll_window_tree (window)
 
              /* Position cursor in window.  */
              if (!hscroll_relative_p && hscroll_step_abs == 0)
-               hscroll = max (0, it.current_x - text_area_width / 2)
+               hscroll = max (0, (it.current_x
+                                  - (ITERATOR_AT_END_OF_LINE_P (&it)
+                                     ? (text_area_width - 4 * FRAME_COLUMN_WIDTH (it.f))
+                                     : (text_area_width / 2))))
                          / FRAME_COLUMN_WIDTH (it.f);
              else if (w->cursor.x >= text_area_width - h_margin)
                {