From f606ec90e9d041f464b2a7f596578a4facd0c6c7 Mon Sep 17 00:00:00 2001 From: Yikai Zhao Date: Fri, 5 Apr 2024 22:40:17 +0800 Subject: [PATCH] support range --- evil-commands.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/evil-commands.el b/evil-commands.el index 42c50f4c..e1ed6cf4 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -4203,11 +4203,14 @@ Use `evil-flush-lines' if INVERT is nil, or `evil-keep-lines' if not." (when (and evil-ex-global-command-interactive-highlight (eq flag 'update)) + (when evil-ex-range + (cl-destructuring-bind (beg end &rest) + (evil-expand-range evil-ex-range t) + (evil-ex-hl-set-region 'evil-ex-global beg end))) (condition-case err - (let ((pattern (car (evil-ex-parse-global (or arg ""))))) - (when (> (length pattern) 0) - (evil-ex-hl-change 'evil-ex-global - (evil-ex-make-pattern pattern evil-ex-search-case nil)))) + (when-let ((pattern (car (evil-ex-parse-global (or arg ""))))) + (evil-ex-hl-change 'evil-ex-global + (evil-ex-make-pattern pattern evil-ex-search-case nil))) (user-error (evil-ex-echo (error-message-string err)))))))) (evil-define-operator evil-ex-global