emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xdisp.c,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/xdisp.c,v
Date: Wed, 16 Jul 2008 17:48:11 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      08/07/16 17:48:10

Index: xdisp.c
===================================================================
RCS file: /sources/emacs/emacs/src/xdisp.c,v
retrieving revision 1.1234
retrieving revision 1.1235
diff -u -b -r1.1234 -r1.1235
--- xdisp.c     15 Jul 2008 18:15:18 -0000      1.1234
+++ xdisp.c     16 Jul 2008 17:48:09 -0000      1.1235
@@ -7064,6 +7064,24 @@
                         EMACS_INT to_charpos, int to_x,
                         enum move_operation_enum op)
 {
+  if (it->line_wrap == WORD_WRAP
+      && (op & MOVE_TO_X))
+    {
+      struct it save_it = *it;
+      int skip = move_it_in_display_line_to (it, to_charpos, to_x, op);
+      /* When word-wrap is on, TO_X may lie past the end
+        of a wrapped line.  Then it->current is the
+        character on the next line, so backtrack to the
+        space before the wrap point.  */
+      if (skip == MOVE_LINE_CONTINUED)
+       {
+         int prev_x = max (it->current_x - 1, 0);
+         *it = save_it;
+         move_it_in_display_line_to
+           (it, -1, prev_x, MOVE_TO_X);
+       }
+    }
+  else
   move_it_in_display_line_to (it, to_charpos, to_x, op);
 }
 




reply via email to

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