* lisp/simple.el (previous-line-or-history-element): Fix off-by-one error.

(bug#79746)
This commit is contained in:
Juri Linkov
2025-11-02 09:41:05 +02:00
parent dd9d1df4fa
commit fae5ced1ac

View File

@@ -3191,12 +3191,12 @@ previous element of the minibuffer history in the minibuffer."
;; Avoid moving point to the prompt
(when (< (point) (minibuffer-prompt-end))
;; If there is minibuffer contents on the same line
(if (<= (minibuffer-prompt-end)
(save-excursion
(if (or truncate-lines (not line-move-visual))
(end-of-line)
(end-of-visual-line))
(point)))
(if (< (minibuffer-prompt-end)
(save-excursion
(if (or truncate-lines (not line-move-visual))
(end-of-line)
(end-of-visual-line))
(point)))
;; Move to the beginning of minibuffer contents
(goto-char (minibuffer-prompt-end))
;; Otherwise, go to the previous history element