[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ad1c0ab 5/5: Merge commit 'ac0fc8962eaa15625b127c32f75d2b3
From: |
Oleh Krehel |
Subject: |
[elpa] master ad1c0ab 5/5: Merge commit 'ac0fc8962eaa15625b127c32f75d2b3daa1ca6ef' from swiper |
Date: |
Mon, 20 Apr 2015 14:13:24 +0000 |
branch: master
commit ad1c0ab291d7bd2a2a39a54a897b91dcf1e065ad
Merge: 2f4c2c1 ac0fc89
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Merge commit 'ac0fc8962eaa15625b127c32f75d2b3daa1ca6ef' from swiper
---
packages/swiper/counsel.el | 5 +++++
packages/swiper/ivy.el | 10 +++++++++-
packages/swiper/swiper.el | 6 +++---
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/packages/swiper/counsel.el b/packages/swiper/counsel.el
index 4a97913..1b5e260 100644
--- a/packages/swiper/counsel.el
+++ b/packages/swiper/counsel.el
@@ -175,6 +175,11 @@
(when file
(find-file file))))
+(defun counsel-git-grep-count (str)
+ "Quickly count the amount of git grep STR matches."
+ (shell-command-to-string
+ (format "git grep -c '%s' | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END
{print s}'" str)))
+
(defun counsel-git-grep-function (string &optional _pred &rest _unused)
"Grep in the current git repository for STRING."
(split-string
diff --git a/packages/swiper/ivy.el b/packages/swiper/ivy.el
index 2802f07..c4a4913 100644
--- a/packages/swiper/ivy.el
+++ b/packages/swiper/ivy.el
@@ -84,12 +84,16 @@ Only \"./\" and \"../\" apply here. They appear in reverse
order."
(define-key map (kbd "C-j") 'ivy-alt-done)
(define-key map (kbd "C-n") 'ivy-next-line)
(define-key map (kbd "C-p") 'ivy-previous-line)
+ (define-key map (kbd "<down>") 'ivy-next-line)
+ (define-key map (kbd "<up>") 'ivy-previous-line)
(define-key map (kbd "C-s") 'ivy-next-line-or-history)
(define-key map (kbd "C-r") 'ivy-previous-line-or-history)
(define-key map (kbd "SPC") 'self-insert-command)
(define-key map (kbd "DEL") 'ivy-backward-delete-char)
(define-key map (kbd "M-<") 'ivy-beginning-of-buffer)
(define-key map (kbd "M->") 'ivy-end-of-buffer)
+ (define-key map (kbd "<left>") 'ivy-beginning-of-buffer)
+ (define-key map (kbd "<right>") 'ivy-end-of-buffer)
(define-key map (kbd "M-n") 'ivy-next-history-element)
(define-key map (kbd "M-p") 'ivy-previous-history-element)
(define-key map (kbd "C-g") 'minibuffer-keyboard-quit)
@@ -584,7 +588,11 @@ CANDIDATES is a list of strings."
ivy--old-cands)
((and ivy--old-re
(not (equal ivy--old-re ""))
- (eq 0 (cl-search ivy--old-re re)))
+ (memq (cl-search
+ (if (string-match "\\\\)$" ivy--old-re)
+ (substring ivy--old-re 0 -2)
+ ivy--old-re)
+ re) '(0 2)))
(ignore-errors
(cl-remove-if-not
(lambda (x) (string-match re x))
diff --git a/packages/swiper/swiper.el b/packages/swiper/swiper.el
index 3190d92..1afd056 100644
--- a/packages/swiper/swiper.el
+++ b/packages/swiper/swiper.el
@@ -153,9 +153,6 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(interactive)
(swiper--ivy initial-input))
-(defvar swiper--overlays nil
- "Store overlays.")
-
(defvar swiper--anchor nil
"A line number to which the search should be anchored.")
@@ -208,6 +205,9 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(setq expose (overlay-get ov 'isearch-open-invisible)))
(funcall expose ov)))))
+(defvar swiper--overlays nil
+ "Store overlays.")
+
(defun swiper--cleanup ()
"Clean up the overlays."
(while swiper--overlays