emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-goggles 902270eea8 084/225: Show a vertical visual hi


From: ELPA Syncer
Subject: [nongnu] elpa/evil-goggles 902270eea8 084/225: Show a vertical visual hint for vertical text objects.
Date: Wed, 12 Jan 2022 08:58:54 -0500 (EST)

branch: elpa/evil-goggles
commit 902270eea80594577d9af26298998406f79e59a0
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>

    Show a vertical visual hint for vertical text objects.
    
    With this change, the visual hint for actions such as `y C-v 3j` will
    correctly show a vertical visual hint. Fix #1
---
 evil-goggles.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/evil-goggles.el b/evil-goggles.el
index 560a8e60aa..044b73f95a 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -54,6 +54,15 @@
   :group 'evil-goggles)
 
 (defun evil-goggles--show (beg end face)
+  "Show overlay in region from BEG to END with FACE.
+
+If variable `evil-this-type' is 'block, the overlay will be a block,
+otherwise - a region."
+  (if (eq evil-this-type 'block)
+      (evil-goggles--show-block beg end face)
+    (evil-goggles--show-region beg end face)))
+
+(defun evil-goggles--show-region (beg end face)
   "Show overlay in region from BEG to END with FACE."
   (let ((ov (evil-goggles--make-overlay beg end 'face face)))
     (unwind-protect
@@ -101,7 +110,6 @@ overlay must not be displayed.")
        (>= (point-max) end beg)
        (not (evil-visual-state-p))
        (not (evil-insert-state-p))
-       (not (eq evil-this-type 'block))
        ;; don't show overlay when the region has nothing but whitespace
        (not (null (string-match-p "[^ \t\n]" (buffer-substring-no-properties 
beg end))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]