diff --git a/modules/feature/evil/autoload/evil-mc.el b/modules/feature/evil/autoload/evil-mc.el index 5e76a5d8e..af1b58de7 100644 --- a/modules/feature/evil/autoload/evil-mc.el +++ b/modules/feature/evil/autoload/evil-mc.el @@ -50,16 +50,24 @@ cursor at the final match. If BANG, then treat PATTERN as literal." :move-point nil :evil-mc t (interactive "") + (unless (and (stringp pattern) + (not (string-empty-p pattern))) + (user-error "A regexp pattern is required")) (require 'evil-mc) - (setq evil-mc-pattern (cons (evil-mc-make-pattern (if bang (regexp-quote pattern) pattern) nil) - (list beg end type))) + (setq evil-mc-pattern + (cons (evil-mc-make-pattern (if bang (regexp-quote pattern) pattern) + nil) + (list beg end type))) (save-excursion (evil-with-restriction beg end - (evil-mc-make-cursors-for-all) - (evil-mc-print-cursors-info "Created"))) + (evil-mc-make-cursors-for-all))) (evil-exit-visual-state) (evil-mc-goto-cursor (if (= (evil-visual-direction) 1) (evil-mc-find-last-cursor) (evil-mc-find-first-cursor)) - nil)) + nil) + (evil-mc-undo-cursor-at-pos (point)) + (if (evil-mc-has-cursors-p) + (evil-mc-print-cursors-info "Created") + (evil-mc-message "No cursors were created")))