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

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

[elpa] master 7c9d960 143/399: swiper.el (swiper--add-cursor-overlay): E


From: Oleh Krehel
Subject: [elpa] master 7c9d960 143/399: swiper.el (swiper--add-cursor-overlay): Extract
Date: Sat, 20 Jul 2019 14:57:11 -0400 (EDT)

branch: master
commit 7c9d960b12d68f0443284a9f26c9f74abde9685d
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    swiper.el (swiper--add-cursor-overlay): Extract
---
 swiper.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/swiper.el b/swiper.el
index 307eb4d..e06098b 100644
--- a/swiper.el
+++ b/swiper.el
@@ -1155,6 +1155,13 @@ See `ivy-format-function' for further information."
         (ivy-set-index idx-found))
       (setq ivy--old-cands (nreverse cands)))))
 
+(defun swiper--add-cursor-overlay ()
+  (let ((ov (make-overlay (point) (if (eolp) (point) (1+ (point))))))
+    (if (eolp)
+        (overlay-put ov 'after-string (propertize " " 'face 'ivy-cursor))
+      (overlay-put ov 'face 'ivy-cursor))
+    (push ov swiper--overlays)))
+
 (defun swiper-isearch-action (x)
   "Move to X for `swiper-isearch'."
   (if (> (length x) 0)
@@ -1165,11 +1172,7 @@ See `ivy-format-function' for further information."
         (unless (eq ivy-exit 'done)
           (swiper--cleanup)
           (swiper--add-overlays (ivy--regex ivy-text))
-          (let ((ov (make-overlay (point) (if (eolp) (point) (1+ (point))))))
-            (if (eolp)
-                (overlay-put ov 'after-string (propertize " " 'face 
'ivy-cursor))
-              (overlay-put ov 'face 'ivy-cursor))
-            (push ov swiper--overlays))))
+          (swiper--add-cursor-overlay)))
     (swiper--cleanup)))
 
 (defun swiper-isearch (&optional initial-input)



reply via email to

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