[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f5b8bf2 079/167: Highlight modified file buffers with 'ivy
From: |
Oleh Krehel |
Subject: |
[elpa] master f5b8bf2 079/167: Highlight modified file buffers with 'ivy-modified-buffer face |
Date: |
Tue, 08 Dec 2015 10:50:01 +0000 |
branch: master
commit f5b8bf2d4f05d479741ec5d2c569f9c6eee0c119
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Highlight modified file buffers with 'ivy-modified-buffer face
* ivy.el (ivy-modified-buffer): New face, blank by default.
(ivy--format): When the collection is 'internal-complete-buffer,
highlight unsaved file visiting buffers with 'ivy-modified-buffer.
Fixes #280
Example custom setting for 'ivy-modified-buffer:
(custom-set-faces
'(ivy-modified-buffer ((t (:background "#ff7777")))))
---
ivy.el | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 4cde295..e33d71c 100644
--- a/ivy.el
+++ b/ivy.el
@@ -63,6 +63,10 @@
'((t (:inherit 'dired-directory)))
"Face used by Ivy for highlighting subdirs in the alternatives.")
+(defface ivy-modified-buffer
+ '((t :inherit 'default))
+ "Face used by Ivy for highlighting modified file visiting buffers.")
+
(defface ivy-remote
'((t (:foreground "#110099")))
"Face used by Ivy for highlighting remotes in the alternatives.")
@@ -1860,12 +1864,21 @@ CANDS is a list of strings."
(start (max 0 (min start (- end (1- ivy-height)))))
(cands (cl-subseq cands start end))
(index (- ivy--index start)))
- (when ivy--directory
- (setq cands (mapcar (lambda (x)
- (if (string-match-p "/\\'" x)
- (propertize x 'face 'ivy-subdir)
- x))
- cands)))
+ (cond (ivy--directory
+ (setq cands (mapcar (lambda (x)
+ (if (string-match-p "/\\'" x)
+ (propertize x 'face 'ivy-subdir)
+ x))
+ cands)))
+ ((eq (ivy-state-collection ivy-last) 'internal-complete-buffer)
+ (setq cands (mapcar (lambda (x)
+ (let ((b (get-buffer x)))
+ (if (and b
+ (buffer-file-name b)
+ (buffer-modified-p b))
+ (propertize x 'face
'ivy-modified-buffer)
+ x)))
+ cands))))
(setq ivy--current (copy-sequence (nth index cands)))
(setq cands (mapcar
#'ivy--format-minibuffer-line
- [elpa] master e338785 057/167: ivy.el (ivy-sort-functions-alist): Upgrade to defcustom, (continued)
- [elpa] master e338785 057/167: ivy.el (ivy-sort-functions-alist): Upgrade to defcustom, Oleh Krehel, 2015/12/08
- [elpa] master 71695df 065/167: "C-j" should not stop completion for a pasted file path, Oleh Krehel, 2015/12/08
- [elpa] master dfd6204 064/167: Fix pasting file paths on Windows, Oleh Krehel, 2015/12/08
- [elpa] master 1af25f6 067/167: swiper.el (swiper-font-lock-ensure): Amend exception list, Oleh Krehel, 2015/12/08
- [elpa] master 5f22310 069/167: counsel.el (counsel-git): Update default-directory, Oleh Krehel, 2015/12/08
- [elpa] master 4a04d6e 031/167: Default ivy-display-style to 'fancy for Emacs>=24.5, Oleh Krehel, 2015/12/08
- [elpa] master 3ae4f1a 052/167: ivy-test.el (swiper--re-builder): Update, Oleh Krehel, 2015/12/08
- [elpa] master 713fd6d 049/167: Try to fix the previous commit, Oleh Krehel, 2015/12/08
- [elpa] master 297f48a 074/167: ivy.el: "M-n" should prefer url at point to symbol at point, Oleh Krehel, 2015/12/08
- [elpa] master 0e6c13b 076/167: swiper.el (swiper-font-lock-ensure): Exclude eems-stream-mode, Oleh Krehel, 2015/12/08
- [elpa] master f5b8bf2 079/167: Highlight modified file buffers with 'ivy-modified-buffer face,
Oleh Krehel <=
- [elpa] master 70f6055 077/167: counsel.el (counsel-git-grep-query-replace): Add and bind to "M-q", Oleh Krehel, 2015/12/08
- [elpa] master 86d0884 087/167: fix 1-too-far scrolling issue, Oleh Krehel, 2015/12/08
- [elpa] master 16ccb0f 084/167: swiper.el (swiper-font-lock-ensure): Exclude debbugs-gnu-mode, Oleh Krehel, 2015/12/08
- [elpa] master d41cc69 086/167: Pulse after ivy-occur-press, Oleh Krehel, 2015/12/08
- [elpa] master c6cc3f9 089/167: counsel.el (counsel-rhythmbox): Add :caller, Oleh Krehel, 2015/12/08
- [elpa] master 2f1133a 083/167: ivy.el (ivy-occur): Add and bind to "C-c o", Oleh Krehel, 2015/12/08
- [elpa] master 2797a9b 090/167: ivy.el (ivy-minibuffer-map): Bind "C-M-a" to ivy-read-action, Oleh Krehel, 2015/12/08
- [elpa] master 564e235 091/167: ivy.el (ivy-occur-press): Extend with-ivy-window, Oleh Krehel, 2015/12/08
- [elpa] master e9ba89e 085/167: Make ivy work with enable-recursive-minibuffers, Oleh Krehel, 2015/12/08
- [elpa] master 7a069be 088/167: ivy.el (ivy-occur-press): Work with counsel-rhythmbox, Oleh Krehel, 2015/12/08