[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil 4ed0543c92 2/2: evil-read: Make point end up at the l
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil 4ed0543c92 2/2: evil-read: Make point end up at the last line of any shell output |
Date: |
Sun, 13 Feb 2022 18:57:54 -0500 (EST) |
branch: elpa/evil
commit 4ed0543c9235f97748d4a4913cfdce03fee0e17c
Author: Brian Leung <leungbk@posteo.net>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
evil-read: Make point end up at the last line of any shell output
---
evil-commands.el | 6 +++---
evil-tests.el | 7 +++++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/evil-commands.el b/evil-commands.el
index 7c6a299b3d..ff8ee3f4d5 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -3205,9 +3205,9 @@ If no FILE is specified, reload the current buffer from
disk."
(unless (bolp) (insert "\n")))))
(t
(shell-command (evil-ex-replace-special-filenames (substring file 1)) t)
- (save-excursion
- (goto-char (mark))
- (unless (bolp) (insert "\n")))))))
+ (goto-char (mark))
+ (unless (bolp) (insert "\n"))
+ (forward-line -1)))))
(evil-define-command evil-show-files ()
"Shows the file-list.
diff --git a/evil-tests.el b/evil-tests.el
index eb638cf074..0e313b52fb 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -8149,6 +8149,13 @@ maybe we need one line more with some text\n")
(buffer-file-name) "\n"
"2\n"
"1\n")))))
+ (ert-info ("Ensure that point ends up at the last line of shell output, if
any")
+ (evil-with-temp-file name
+ "3\n2\n1\n"
+ (evil-test-buffer
+ "[l]ine 1\nline 2"
+ ((vconcat ":read !cat " name [return]))
+ "line 1\n3\n2\n[1]\nline 2")))
(ert-info ("Test insertion of shell command without trailing newline")
(ert-info ("with space")
(evil-test-buffer