diff options
| -rw-r--r-- | evil-commands.el | 9 | ||||
| -rw-r--r-- | evil-search.el | 7 | ||||
| -rw-r--r-- | evil-tests.el | 7 |
3 files changed, 16 insertions, 7 deletions
diff --git a/evil-commands.el b/evil-commands.el index fc8641c..d860238 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -3108,10 +3108,11 @@ If ARG is nil this function calls `recompile', otherwise it calls :entries (cl-loop for (key . val) in (evil-register-list) collect `(nil [,(char-to-string key) - ,(or (and val - (stringp val) - (replace-regexp-in-string "\n" "^J" val)) - "")])))) + ,(cond ((stringp val) + (replace-regexp-in-string "\n" "^J" val)) + ((vectorp val) + (key-description val)) + (t ""))])))) (evil-define-command evil-show-marks (mrks) "Shows all marks. diff --git a/evil-search.el b/evil-search.el index a5b9f2d..b995866 100644 --- a/evil-search.el +++ b/evil-search.el @@ -1210,9 +1210,10 @@ This handler highlights the pattern of the current substitution." (defun evil-ex-parse-global (string) "Parse STRING as a global argument." - (let* ((args (evil-delimited-arguments string 2)) - (pattern (nth 0 args)) - (command (nth 1 args))) + (let* ((pattern (nth 0 (evil-delimited-arguments string 2))) + (command (and pattern + (>= (- (length string) (length pattern)) 2) + (substring string (+ (length pattern) 2))))) ;; use last pattern if none given (when (zerop (length pattern)) (setq pattern diff --git a/evil-tests.el b/evil-tests.el index 708e768..6928f34 100644 --- a/evil-tests.el +++ b/evil-tests.el @@ -7333,6 +7333,13 @@ maybe we need one line more with some text\n") "no 1\nno 2\nno x\nyes 4\nno x\nno x\n[n]o 7\n" ("u") "no 1\nno 2\nno [3]\nyes 4\nno 5\nno 6\nno 7\n")) + (ert-info ("global substitute with trailing slash") + (evil-test-buffer + "[n]o 1\nno 2\nno 3\nyes 4\nno 5\nno 6\nno 7\n" + (":g/no/s/[3-6]/x/" [return]) + "no 1\nno 2\nno x\nyes 4\nno x\nno x\n[n]o 7\n" + ("u") + "no 1\nno 2\nno [3]\nyes 4\nno 5\nno 6\nno 7\n")) (evil-select-search-module 'evil-search-module 'evil-search) (ert-info ("global use last match if none given, with evil-search") (evil-test-buffer |
