summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el22
1 files changed, 4 insertions, 18 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 3d625bd2886..f8c02c1dbfe 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -6002,10 +6002,6 @@ columns by which window is scrolled from left margin.
When the `track-eol' feature is doing its job, the value is
`most-positive-fixnum'.")
-(defvar last--line-number-width 0
- "Last value of width used for displaying line numbers.
-Used internally by `line-move-visual'.")
-
(defcustom line-move-ignore-invisible t
"Non-nil means commands that move by lines ignore invisible newlines.
When this option is non-nil, \\[next-line], \\[previous-line], \\[move-end-of-line], and \\[move-beginning-of-line] behave
@@ -6284,19 +6280,9 @@ If NOERROR, don't signal an error if we can't move that many lines."
(memq last-command `(next-line previous-line ,this-command)))
;; If so, there's no need to reset `temporary-goal-column',
;; but we may need to hscroll.
- (progn
- (if (or (/= (cdr temporary-goal-column) hscroll)
- (> (cdr temporary-goal-column) 0))
- (setq target-hscroll (cdr temporary-goal-column)))
- ;; Update the COLUMN part of temporary-goal-column if the
- ;; line-number display changed its width since the last
- ;; time.
- (setq temporary-goal-column
- (cons (+ (car temporary-goal-column)
- (/ (float (- lnum-width last--line-number-width))
- (frame-char-width)))
- (cdr temporary-goal-column)))
- (setq last--line-number-width lnum-width))
+ (if (or (/= (cdr temporary-goal-column) hscroll)
+ (> (cdr temporary-goal-column) 0))
+ (setq target-hscroll (cdr temporary-goal-column)))
;; Otherwise, we should reset `temporary-goal-column'.
(let ((posn (posn-at-point))
x-pos)
@@ -6306,7 +6292,7 @@ If NOERROR, don't signal an error if we can't move that many lines."
((memq (nth 1 posn) '(right-fringe left-fringe))
(setq temporary-goal-column (cons (window-width) hscroll)))
((car (posn-x-y posn))
- (setq x-pos (car (posn-x-y posn)))
+ (setq x-pos (- (car (posn-x-y posn)) lnum-width))
;; In R2L lines, the X pixel coordinate is measured from the
;; left edge of the window, but columns are still counted
;; from the logical-order beginning of the line, i.e. from