[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 7159d84 03/67: swiper.el (swiper--regex): Zero groups with
From: |
Oleh Krehel |
Subject: |
[elpa] master 7159d84 03/67: swiper.el (swiper--regex): Zero groups without space |
Date: |
Sun, 22 Mar 2015 17:33:48 +0000 |
branch: master
commit 7159d845d1bf0a3a3e5aa8d168076887cceae6be
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
swiper.el (swiper--regex): Zero groups without space
* swiper.el (swiper--update-input): Update the face order accordingly.
---
swiper.el | 48 +++++++++++++++++++++++++++---------------------
1 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/swiper.el b/swiper.el
index 2ead1c5..caf5818 100644
--- a/swiper.el
+++ b/swiper.el
@@ -46,15 +46,15 @@
"Face for `swiper' matches.")
(defface swiper-match-face-2
- '((t (:background "#F15C79")))
+ '((t (:background "#F9A35A")))
"Face for `swiper' matches.")
(defface swiper-match-face-3
- '((t (:background "#F9A35A")))
+ '((t (:background "#fb7905")))
"Face for `swiper' matches.")
(defface swiper-match-face-4
- '((t (:background "#fb7905")))
+ '((t (:background "#F15C79")))
"Face for `swiper' matches.")
(defface swiper-line-face
@@ -160,10 +160,13 @@
(let ((overlay (make-overlay (match-beginning i)
(match-end i)))
(face
- (if (zerop i)
- (car swiper-faces)
- (nth (1+ (mod i (1- (length swiper-faces))))
- swiper-faces))))
+ (cond ((zerop swiper--subexps)
+ (caddr swiper-faces))
+ ((zerop i)
+ (car swiper-faces))
+ (t
+ (nth (1+ (mod (1- i) (1- (length
swiper-faces))))
+ swiper-faces)))))
(push overlay swiper--overlays)
(overlay-put overlay 'face face)
(overlay-put overlay 'priority i)
@@ -251,20 +254,23 @@
(defun swiper--regex ()
"Re-build regex in case it has a space."
- (cdr
- (let ((hashed (gethash helm-input swiper--regex-hash)))
- (if hashed
- (prog1 hashed
- (setq swiper--subexps (car hashed)))
- (puthash helm-input
- (let ((subs (split-string helm-input " +" t)))
- (cons
- (setq swiper--subexps (length subs))
- (mapconcat
- (lambda (x) (format "\\(%s\\)" x))
- subs
- ".*")))
- swiper--regex-hash)))))
+ (let ((hashed (gethash helm-input swiper--regex-hash)))
+ (if hashed
+ (prog1 (cdr hashed)
+ (setq swiper--subexps (car hashed)))
+ (cdr (puthash helm-input
+ (let ((subs (split-string helm-input " +" t)))
+ (if (= (length subs) 1)
+ (cons
+ (setq swiper--subexps 0)
+ (car subs))
+ (cons
+ (setq swiper--subexps (length subs))
+ (mapconcat
+ (lambda (x) (format "\\(%s\\)" x))
+ subs
+ ".*"))))
+ swiper--regex-hash)))))
(defun swiper--action (x)
"Goto line X."
- [elpa] master updated (5aa7896 -> 302a16a), Oleh Krehel, 2015/03/22
- [elpa] master c990320 02/67: Update call to `font-lock-ensure', Oleh Krehel, 2015/03/22
- [elpa] master 7159d84 03/67: swiper.el (swiper--regex): Zero groups without space,
Oleh Krehel <=
- [elpa] master 3a4cb1f 05/67: Add compatibility alias for `font-lock-ensure', Oleh Krehel, 2015/03/22
- [elpa] master fed3aff 04/67: README.md: Add, Oleh Krehel, 2015/03/22
- [elpa] master 16be7e1 01/67: Initial import, Oleh Krehel, 2015/03/22
- [elpa] master ff0ee94 06/67: Add dependency on emacs 24.1, Oleh Krehel, 2015/03/22
- [elpa] master 1c0b30b 07/67: add autoload cookie for lazy loading, Oleh Krehel, 2015/03/22
- [elpa] master 1099ebf 08/67: Use cl-lib macros instead of cl.el, Oleh Krehel, 2015/03/22
- [elpa] master 7b86747 09/67: swiper.el (swiper--regex): Update signature, Oleh Krehel, 2015/03/22
- [elpa] master a267b34 10/67: familiar isearch key bindings while helm is active, Oleh Krehel, 2015/03/22
- [elpa] master a817342 14/67: ivy.el: Improve the highlighting in the minibuffer, Oleh Krehel, 2015/03/22
- [elpa] master 97ab66a 13/67: README.md: Update, Oleh Krehel, 2015/03/22