diff options
| author | Juri Linkov | 2020-08-21 02:21:26 +0300 |
|---|---|---|
| committer | Juri Linkov | 2020-08-21 02:21:26 +0300 |
| commit | 4c5043c50b52e404c211c18da8cd59a2ee86253d (patch) | |
| tree | 35d789b3c741627f93891e4e81994dfbda975218 | |
| parent | cb9fc5e7731e506e4e0facd3d060d19e388b32ac (diff) | |
| download | emacs-4c5043c50b52e404c211c18da8cd59a2ee86253d.tar.gz emacs-4c5043c50b52e404c211c18da8cd59a2ee86253d.zip | |
* lisp/simple.el (previous-line-or-history-element): Handle logical lines.
When 'line-move-visual' is nil, use 'end-of-line' to move point to the end
of the first logical line (bug#42862)
Thanks to Michael Welsh Duggan <mwd@md5i.com>.
| -rw-r--r-- | lisp/simple.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index f08015372af..b106d4b0ba7 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2416,15 +2416,17 @@ previous element of the minibuffer history in the minibuffer." | |||
| 2416 | (goto-char (1- (minibuffer-prompt-end))) | 2416 | (goto-char (1- (minibuffer-prompt-end))) |
| 2417 | (current-column)))) | 2417 | (current-column)))) |
| 2418 | (move-to-column old-column)) | 2418 | (move-to-column old-column)) |
| 2419 | ;; Put the cursor at the end of the visual line instead of the | 2419 | (if (not line-move-visual) ; Handle logical lines (bug#42862) |
| 2420 | ;; logical line, so the next `previous-line-or-history-element' | 2420 | (end-of-line) |
| 2421 | ;; would move to the previous history element, not to a possible upper | 2421 | ;; Put the cursor at the end of the visual line instead of the |
| 2422 | ;; visual line from the end of logical line in `line-move-visual' mode. | 2422 | ;; logical line, so the next `previous-line-or-history-element' |
| 2423 | (end-of-visual-line) | 2423 | ;; would move to the previous history element, not to a possible upper |
| 2424 | ;; Since `end-of-visual-line' puts the cursor at the beginning | 2424 | ;; visual line from the end of logical line in `line-move-visual' mode. |
| 2425 | ;; of the next visual line, move it one char back to the end | 2425 | (end-of-visual-line) |
| 2426 | ;; of the first visual line (bug#22544). | 2426 | ;; Since `end-of-visual-line' puts the cursor at the beginning |
| 2427 | (unless (eolp) (backward-char 1))))))) | 2427 | ;; of the next visual line, move it one char back to the end |
| 2428 | ;; of the first visual line (bug#22544). | ||
| 2429 | (unless (eolp) (backward-char 1)))))))) | ||
| 2428 | 2430 | ||
| 2429 | (defun next-complete-history-element (n) | 2431 | (defun next-complete-history-element (n) |
| 2430 | "Get next history element that completes the minibuffer before the point. | 2432 | "Get next history element that completes the minibuffer before the point. |