[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 88b3548 020/399: swiper.el (swiper--avy-goto): Extract
From: |
Oleh Krehel |
Subject: |
[elpa] master 88b3548 020/399: swiper.el (swiper--avy-goto): Extract |
Date: |
Sat, 20 Jul 2019 14:56:40 -0400 (EDT) |
branch: master
commit 88b35486c5751e48e0b36ca0dbce91bf56a378d6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--avy-goto): Extract
---
swiper.el | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/swiper.el b/swiper.el
index 2e3a4e9..0fd7d06 100644
--- a/swiper.el
+++ b/swiper.el
@@ -208,6 +208,22 @@
(avy-push-mark))
(avy--done))))
+(defun swiper--avy-goto (candidate)
+ (if (window-minibuffer-p (cdr candidate))
+ (let ((cand-text (save-excursion
+ (goto-char (car candidate))
+ (buffer-substring-no-properties
+ (line-beginning-position)
+ (line-end-position)))))
+ (ivy-set-index (cl-position-if
+ (lambda (x) (cl-search x cand-text))
+ ivy--old-cands))
+ (ivy--exhibit)
+ (ivy-done)
+ (ivy-call))
+ (ivy-quit-and-run
+ (avy-action-goto (avy-candidate-beg candidate)))))
+
;;;###autoload
(defun swiper-avy ()
"Jump to one of the current swiper candidates."
@@ -215,21 +231,7 @@
(unless (require 'avy nil 'noerror)
(error "Package avy isn't installed"))
(unless (string= ivy-text "")
- (let ((candidate (swiper--avy-candidate)))
- (if (window-minibuffer-p (cdr candidate))
- (let ((cand-text (save-excursion
- (goto-char (car candidate))
- (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position)))))
- (ivy-set-index (cl-position-if
- (lambda (x) (cl-search x cand-text))
- ivy--old-cands))
- (ivy--exhibit)
- (ivy-done)
- (ivy-call))
- (ivy-quit-and-run
- (avy-action-goto (avy-candidate-beg candidate)))))))
+ (swiper--avy-goto (swiper--avy-candidate))))
(declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core")
(declare-function multiple-cursors-mode "ext:multiple-cursors-core")
- [elpa] master da85d1e 016/399: ivy.el: Require TRAMP earlier, (continued)
- [elpa] master da85d1e 016/399: ivy.el: Require TRAMP earlier, Oleh Krehel, 2019/07/20
- [elpa] master 98b70a7 011/399: swiper.el (swiper--update-input-ivy): Don't recenter when non-graphical, Oleh Krehel, 2019/07/20
- [elpa] master e86cf2e 010/399: counsel.el (counsel-require-program): Change arg meaning, Oleh Krehel, 2019/07/20
- [elpa] master 007d672 012/399: swiper.el (swiper--update-input-ivy): Use display-graphic-p, Oleh Krehel, 2019/07/20
- [elpa] master 686cf5a 014/399: swiper.el (swiper--action): Fix for emacs -nw, Oleh Krehel, 2019/07/20
- [elpa] master b1ac725 017/399: ivy.el (ivy-initial-inputs-alist): Now a defcustom., Oleh Krehel, 2019/07/20
- [elpa] master 43f169b 019/399: swiper.el (swiper-font-lock-ensure-p): Try checking for non prog-mode, Oleh Krehel, 2019/07/20
- [elpa] master 24c95b7 018/399: ivy.el (ivy-thing-at-point): Extend, Oleh Krehel, 2019/07/20
- [elpa] master 51446e5 021/399: swiper.el (swiper--avy-candidates): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 050b4a4 023/399: counsel.el (counsel-grep-history): Add, Oleh Krehel, 2019/07/20
- [elpa] master 88b3548 020/399: swiper.el (swiper--avy-goto): Extract,
Oleh Krehel <=
- [elpa] master 28e88ab 025/399: Allow to mark/unmark candidates with "m", "u", "DEL", "t", Oleh Krehel, 2019/07/20
- [elpa] master 48c7087 028/399: ivy.el (ivy-reverse-i-search): Don't bind ivy-recursive-restore to nil, Oleh Krehel, 2019/07/20
- [elpa] master 6853290 031/399: counsel-switch-buffer: Add support for ivy-use-virtual-buffers., Oleh Krehel, 2019/07/20
- [elpa] master b0c0371 038/399: Enable counsel-read-env to properly handle directories, Oleh Krehel, 2019/07/20
- [elpa] master 47c8c3d 034/399: counsel.el (counsel-read-env): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 4ca721c 022/399: swiper.el (swiper-avy): If the input is 1 char, re-highlight, Oleh Krehel, 2019/07/20
- [elpa] master ffffc21 024/399: swiper.el (swiper-mc): Update doc, Oleh Krehel, 2019/07/20
- [elpa] master b01108e 027/399: ivy.el (ivy-call): Call action with whole marked list if it has a second arg, Oleh Krehel, 2019/07/20
- [elpa] master 3216d40 026/399: swiper.el (swiper-avy): Warn if no input, Oleh Krehel, 2019/07/20
- [elpa] master dfeaec0 029/399: swiper.el (swiper--update-input-ivy): Don't rely on window-start in terminal, Oleh Krehel, 2019/07/20