emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 r117276: Fix bug #17823 with vertical-motion in l


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117276: Fix bug #17823 with vertical-motion in lines with line-prefix.
Date: Sat, 21 Jun 2014 12:31:50 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117276
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17823
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-06-21 15:30:02 +0300
message:
  Fix bug #17823 with vertical-motion in lines with line-prefix.
  
   src/indent.c (Fvertical_motion): Move to the goal column, if any,
   with a single call to move_it_in_display_line, not in two calls.
   Doing this with two calls causes move_it_in_display_line apply the
   line-prefix handling twice instead of just once.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/indent.c                   indent.c-20091113204419-o5vbwnq5f7feedwu-181
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-06-21 08:17:29 +0000
+++ b/src/ChangeLog     2014-06-21 12:30:02 +0000
@@ -1,6 +1,10 @@
 2014-06-21  Eli Zaretskii  <address@hidden>
 
        * indent.c (Fvertical_motion): Doc fix.
+       Move to the goal column, if any, with a single call to
+       move_it_in_display_line, not in two calls.  Doing this with two
+       calls causes move_it_in_display_line apply the line-prefix
+       handling twice instead of just once.  (Bug#17823)
 
 2014-06-21  Paul Eggert  <address@hidden>
 

=== modified file 'src/indent.c'
--- a/src/indent.c      2014-06-21 08:17:29 +0000
+++ b/src/indent.c      2014-06-21 12:30:02 +0000
@@ -2129,20 +2129,14 @@
            }
        }
 
-      /* Move to the goal column, if one was specified.  */
+      /* Move to the goal column, if one was specified.  If the window
+        was originally hscrolled, the goal column is interpreted as
+        an addition to the hscroll amount.  */
       if (!NILP (lcols))
        {
-         /* If the window was originally hscrolled, move forward by
-            the hscrolled amount first.  */
-         if (first_x > 0)
-           {
-             move_it_in_display_line (&it, ZV, first_x, MOVE_TO_X);
-             it.current_x = 0;
-           }
-         move_it_in_display_line
-           (&it, ZV,
-            (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5),
-            MOVE_TO_X);
+         int to_x = (int)(cols * FRAME_COLUMN_WIDTH (XFRAME (w->frame)) + 0.5);
+
+         move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
        }
 
       SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));


reply via email to

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