branch: master
commit e6f49c2348de0e142a9f3809c845d5e163e0f0f2
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
swiper.el: Reorder by swiper--overlays
---
swiper.el | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/swiper.el b/swiper.el
index 5aa4eb7..1db13b1 100644
--- a/swiper.el
+++ b/swiper.el
@@ -768,6 +768,23 @@ Matched candidates should have `swiper-invocation-face'."
(goto-char (point-min))
(isearch-clean-overlays)))
+(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--add-overlay (beg end face wnd priority)
+ "Add overlay bound by BEG and END to `swiper--overlays'.
+FACE, WND and PRIORITY are properties corresponding to
+the face, window and priority of the overlay."
+ (let ((overlay (make-overlay beg end)))
+ (push overlay swiper--overlays)
+ (overlay-put overlay 'face face)
+ (overlay-put overlay 'window wnd)
+ (overlay-put overlay 'priority priority)))
+
(defun swiper--recenter-p ()
(or (display-graphic-p)
(not recenter-redisplay)))
@@ -907,16 +924,6 @@ WND, when specified is the window."
wnd i)
(cl-incf i))))))))))))
-(defun swiper--add-overlay (beg end face wnd priority)
- "Add overlay bound by BEG and END to `swiper--overlays'.
-FACE, WND and PRIORITY are properties corresponding to
-the face, window and priority of the overlay."
- (let ((overlay (make-overlay beg end)))
- (push overlay swiper--overlays)
- (overlay-put overlay 'face face)
- (overlay-put overlay 'window wnd)
- (overlay-put overlay 'priority priority)))
-
(defcustom swiper-action-recenter nil
"When non-nil, recenter after exiting `swiper'."
:type 'boolean)
@@ -1252,13 +1259,6 @@ come back to the same place as when \"a\" was initially
entered.")
(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)