aboutsummaryrefslogtreecommitdiff
path: root/evil-commands.el
diff options
context:
space:
mode:
Diffstat (limited to 'evil-commands.el')
-rw-r--r--evil-commands.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/evil-commands.el b/evil-commands.el
index d09da35..7c6a299 100644
--- a/evil-commands.el
+++ b/evil-commands.el
@@ -3195,15 +3195,19 @@ If no FILE is specified, reload the current buffer from disk."
(when (or (not (zerop (forward-line (or count 1))))
(not (bolp)))
(insert "\n"))
- (if (/= (aref file 0) ?!)
- (let ((result (insert-file-contents file)))
- (save-excursion
- (forward-char (cadr result))
- (unless (bolp) (insert "\n"))))
- (shell-command (substring file 1) t)
+ (cond
+ ((/= (aref file 0) ?!)
+ (when (member file '("#" "%"))
+ (setq file (evil-ex-replace-special-filenames file)))
+ (let ((result (insert-file-contents file)))
+ (save-excursion
+ (forward-char (cadr result))
+ (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"))))))
+ (unless (bolp) (insert "\n")))))))
(evil-define-command evil-show-files ()
"Shows the file-list.