emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107782: Fix bug #11133 with verti


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107782: Fix bug #11133 with vertical-motion across a long display string.
Date: Fri, 02 Nov 2012 01:17:35 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 107782
fixes bug: http://debbugs.gnu.org/11133
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2012-04-07 10:54:56 +0300
message:
  Fix bug #11133 with vertical-motion across a long display string.
  
   src/indent.c (Fvertical_motion): If there is a display string at
   point, use it.vpos to compute how many lines to backtrack after 
   move_it_to point.
modified:
  src/ChangeLog
  src/indent.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-04-06 13:10:30 +0000
+++ b/src/ChangeLog     2012-04-07 07:54:56 +0000
@@ -1,3 +1,9 @@
+2012-04-07  Eli Zaretskii  <address@hidden>
+
+       * indent.c (Fvertical_motion): If there is a display string at
+       point, use it.vpos to compute how many lines to backtrack after
+       move_it_to point.  (Bug#11133)
+
 2012-04-06  Eli Zaretskii  <address@hidden>
 
        * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):

=== modified file 'src/indent.c'
--- a/src/indent.c      2012-01-19 07:21:25 +0000
+++ b/src/indent.c      2012-04-07 07:54:56 +0000
@@ -2021,6 +2021,7 @@
       EMACS_INT it_start;
       int first_x, it_overshoot_count = 0;
       int overshoot_handled = 0;
+      int disp_string_at_start_p = 0;
 
       itdata = bidi_shelve_cache ();
       SET_TEXT_POS (pt, PT, PT_BYTE);
@@ -2035,6 +2036,8 @@
        {
          const char *s = SSDATA (it.string);
          const char *e = s + SBYTES (it.string);
+
+         disp_string_at_start_p = it.string_from_display_prop_p;
          while (s < e)
            {
              if (*s++ == '\n')
@@ -2062,7 +2065,8 @@
       /* IT may move too far if truncate-lines is on and PT lies
         beyond the right margin.  IT may also move too far if the
         starting point is on a Lisp string that has embedded
-        newlines.  In these cases, backtrack.  */
+        newlines, or spans several screen lines.  In these cases,
+        backtrack.  */
       if (IT_CHARPOS (it) > it_start)
        {
          /* We need to backtrack also if the Lisp string contains no
@@ -2073,6 +2077,14 @@
              && it.method == GET_FROM_BUFFER
              && it.c == '\n')
            it_overshoot_count = 1;
+         else if (disp_string_at_start_p && it.vpos > 0)
+           {
+             /* This is the case of a display string that spans
+                several screen lines.  In that case, we end up at the
+                end of the string, and it.vpos tells us how many
+                screen lines we need to backtrack.  */
+             it_overshoot_count = it.vpos;
+           }
          if (it_overshoot_count > 0)
            move_it_by_lines (&it, -it_overshoot_count);
 


reply via email to

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