]> git.eshelyaron.com Git - emacs.git/commitdiff
(compute_motion): Check for past vpos/hpos target
authorRichard M. Stallman <rms@gnu.org>
Mon, 25 May 1998 22:33:38 +0000 (22:33 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 25 May 1998 22:33:38 +0000 (22:33 +0000)
before skipping invisible chars.

src/indent.c

index 047f9e822625e4235dd9189a393eb5e8bc6dd6d0..0d49c9515ccd9e0c4d48a1a666af88e28c4e3ba0 100644 (file)
@@ -1095,6 +1095,26 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
          int pos_here = pos;
          int newpos;
 
+         /* Don't skip invisible if we are already at the margin.  */
+         if (vpos > tovpos || vpos == tovpos && hpos >= tohpos)
+           {
+             if (contin_hpos && prev_hpos == 0
+                 && hpos > tohpos
+                 && (contin_hpos == width || wide_column_end_hpos > width))
+               { /* Line breaks because we can't put the character at the
+                    previous line any more.  It is not the multi-column
+                    character continued in middle.  Go back to previous
+                    buffer position, screen position, and set tab offset
+                    to previous value.  It's the beginning of the
+                    line.  */
+                 pos = prev_pos;
+                 pos_byte = prev_pos_byte;
+                 hpos = prev_hpos;
+                 tab_offset = prev_tab_offset;
+               }
+             break;
+           }
+
          /* If the caller says that the screen position came from an earlier
             call to compute_motion, then we've already accounted for the
             overlay strings at point.  This is only true the first time