[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ed9169d 158/167: swiper.el (swiper--update-input-ivy): Add
From: |
Oleh Krehel |
Subject: |
[elpa] master ed9169d 158/167: swiper.el (swiper--update-input-ivy): Add a work-around for "M-j" |
Date: |
Tue, 08 Dec 2015 10:50:42 +0000 |
branch: master
commit ed9169dad4b524d5e3f9678ca51d83a8a2e68dc0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--update-input-ivy): Add a work-around for "M-j"
When `ivy-yank-word' is called, don't move to the line of the current
candidate. We're already there anyway. And not moving helps when there
are multiple occurrences of the current input on the current line.
Fixes #314
---
swiper.el | 34 ++++++++++++++++++----------------
1 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/swiper.el b/swiper.el
index 593f763..2ee60a3 100644
--- a/swiper.el
+++ b/swiper.el
@@ -258,7 +258,8 @@ count."
(require 'outline)
(if (fboundp 'outline-show-all)
(outline-show-all)
- (show-all)))
+ (with-no-warnings
+ (show-all))))
(setq swiper-use-visual-line t))
(setq swiper-use-visual-line nil))
(let ((n-lines (count-lines (point-min) (point-max))))
@@ -437,22 +438,23 @@ Matched candidates should have `swiper-invocation-face'."
(num (if (string-match "^[0-9]+" str)
(string-to-number (match-string 0 str))
0)))
- (goto-char (point-min))
- (when (cl-plusp num)
+ (unless (eq this-command 'ivy-yank-word)
(goto-char (point-min))
- (if swiper-use-visual-line
- (line-move (1- num))
- (forward-line (1- num)))
- (if (and (equal ivy-text "")
- (>= swiper--opoint (line-beginning-position))
- (<= swiper--opoint (line-end-position)))
- (goto-char swiper--opoint)
- (re-search-forward re (line-end-position) t))
- (isearch-range-invisible (line-beginning-position)
- (line-end-position))
- (unless (and (>= (point) (window-start))
- (<= (point) (window-end (ivy-state-window ivy-last) t)))
- (recenter)))
+ (when (cl-plusp num)
+ (goto-char (point-min))
+ (if swiper-use-visual-line
+ (line-move (1- num))
+ (forward-line (1- num)))
+ (if (and (equal ivy-text "")
+ (>= swiper--opoint (line-beginning-position))
+ (<= swiper--opoint (line-end-position)))
+ (goto-char swiper--opoint)
+ (re-search-forward re (line-end-position) t))
+ (isearch-range-invisible (line-beginning-position)
+ (line-end-position))
+ (unless (and (>= (point) (window-start))
+ (<= (point) (window-end (ivy-state-window ivy-last)
t)))
+ (recenter))))
(swiper--add-overlays re)))))
(defun swiper--add-overlays (re &optional beg end wnd)
- [elpa] master 99d214d 142/167: Ivy-resume should restore the buffer for swiper, (continued)
- [elpa] master 99d214d 142/167: Ivy-resume should restore the buffer for swiper, Oleh Krehel, 2015/12/08
- [elpa] master 8abed59 143/167: Add counsel-grep, Oleh Krehel, 2015/12/08
- [elpa] master 3b67044 145/167: Convert ivy formatting functions to dotted pairs., Oleh Krehel, 2015/12/08
- [elpa] master ac09f6b 152/167: Fix the issue caused by recursive swiper calls, Oleh Krehel, 2015/12/08
- [elpa] master a34e532 155/167: swiper.el: Use show-all if outline-show-all isn't there, Oleh Krehel, 2015/12/08
- [elpa] master b57c57d 153/167: Fix the preselect for (swiper "one") again, Oleh Krehel, 2015/12/08
- [elpa] master a585fcd 156/167: Fix due to visual-line-mode weirdness, Oleh Krehel, 2015/12/08
- [elpa] master 1cf32c8 138/167: ivy.org manual edits, Oleh Krehel, 2015/12/08
- [elpa] master 7377445 147/167: Edit documentation strings in ivy.el, Oleh Krehel, 2015/12/08
- [elpa] master 1cceac1 154/167: Fix ivy-resume issue caused by the recursive calls change, Oleh Krehel, 2015/12/08
- [elpa] master ed9169d 158/167: swiper.el (swiper--update-input-ivy): Add a work-around for "M-j",
Oleh Krehel <=
- [elpa] master 0332b3e 151/167: Remove 'field text property for twittering-mode, Oleh Krehel, 2015/12/08
- [elpa] master 5cfe6e6 148/167: Fixes on the previous docstring edits, Oleh Krehel, 2015/12/08
- [elpa] master 435e9d4 159/167: Use :caller for ivy-re-builders-alist, Oleh Krehel, 2015/12/08
- [elpa] master 8dd88e4 149/167: doc/Changelog.org: Update up to 2bec99d, Oleh Krehel, 2015/12/08
- [elpa] master 706349f 160/167: swiper.el (swiper-font-lock-ensure): Add vc-dir-mode, Oleh Krehel, 2015/12/08
- [elpa] master 2a55ada 163/167: doc/Changelog.org: Update up to 706349f, Oleh Krehel, 2015/12/08
- [elpa] master 98a4548 164/167: swiper.el: Bump version to 0.7.0, Oleh Krehel, 2015/12/08
- [elpa] master 84533bb 139/167: Minor fixes to ivy.org and export to ivy.texi, Oleh Krehel, 2015/12/08
- [elpa] master 17872ba 157/167: ivy.el: Structure all faces into ivy-faces custom group, Oleh Krehel, 2015/12/08
- [elpa] master 5a6217a 161/167: counsel.el (counsel-tmm): New command, Oleh Krehel, 2015/12/08