changeset 101849:0750b250db3d

(line-move-visual): Handle overflow-newline-into-fringe.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 07 Feb 2009 05:51:27 +0000
parents 0ab814511c60
children 3d797aaa6494
files lisp/simple.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Sat Feb 07 05:50:44 2009 +0000
+++ b/lisp/simple.el	Sat Feb 07 05:51:27 2009 +0000
@@ -4035,9 +4035,12 @@
 	       (or (memq last-command '(next-line previous-line))
 		   ;; In case we're called from some other command.
 		   (eq last-command this-command)))
-    (let ((x (car (nth 2 (posn-at-point)))))
-      (when x
-	(setq temporary-goal-column (/ (float x) (frame-char-width))))))
+    (let ((posn (posn-at-point))
+	  x)
+      (cond ((eq (nth 1 posn) 'right-fringe) ; overflow-newline-into-fringe
+	     (setq temporary-goal-column (- (window-width) 1)))
+	    ((setq x (car (nth 2 posn)))
+	     (setq temporary-goal-column (/ (float x) (frame-char-width)))))))
   (or (= (vertical-motion
 	  (cons (or goal-column (truncate temporary-goal-column)) arg))
 	 arg)