[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 94f107b 304/399: counsel.el (counsel-mark-ring): Add highl
From: |
Oleh Krehel |
Subject: |
[elpa] master 94f107b 304/399: counsel.el (counsel-mark-ring): Add highlight by candidate |
Date: |
Sat, 20 Jul 2019 14:57:45 -0400 (EDT) |
branch: master
commit 94f107bc3182a71349fdb6e84ed7637223f8ec67
Author: SAITOU Keita <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-mark-ring): Add highlight by candidate
Fixes #2078
---
counsel.el | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index fca4d4b..6de3d7a 100644
--- a/counsel.el
+++ b/counsel.el
@@ -3555,16 +3555,37 @@ This variable has no effect unless
;;* Misc. Emacs
;;** `counsel-mark-ring'
+(defface counsel--mark-ring-highlight
+ '((t (:inherit highlight)))
+ "Face for current `counsel-mark-ring' line.")
+
+(defvar counsel--mark-ring-overray nil
+ "Intarnal overray to highlight line by candidate of `counsel-mark-ring'.")
+
+(defun counsel--mark-ring-add-highlight ()
+ "Add highlight to current line."
+ (setq counsel--mark-ring-overray
+ (make-overlay (line-beginning-position) (1+ (line-end-position))))
+ (with-ivy-window
+ (overlay-put counsel--mark-ring-overray 'face
+ 'counsel--mark-ring-highlight)))
+
+(defun counsel--mark-ring-delete-highlight ()
+ "If `counsel-mark-ring' have highlight, delete highlight."
+ (if counsel--mark-ring-overray (delete-overlay counsel--mark-ring-overray)))
+
(defvar counsel--mark-ring-calling-point 0
"Internal variable to remember calling position.")
(defun counsel--mark-ring-unwind ()
"Return back to calling position of `counsel-mark-ring'."
- (goto-char counsel--mark-ring-calling-point))
+ (goto-char counsel--mark-ring-calling-point)
+ (counsel--mark-ring-delete-highlight))
(defun counsel--mark-ring-update-fn ()
"Show preview by candidate."
(let ((linenum (string-to-number (ivy-state-current ivy-last))))
+ (counsel--mark-ring-delete-highlight)
(unless (= linenum 0)
(with-ivy-window
(forward-line (- linenum (line-number-at-pos)))))))
- [elpa] master a73e24d 288/399: Do not insert initial input if nil, (continued)
- [elpa] master a73e24d 288/399: Do not insert initial input if nil, Oleh Krehel, 2019/07/20
- [elpa] master 0b26219 301/399: counsel.el (counsel--file-name-filter): Move ignore-re binding., Oleh Krehel, 2019/07/20
- [elpa] master ef6d3db 297/399: ivy-overlay.el (ivy-display-function-overlay): Bring back org-indent-mode logic, Oleh Krehel, 2019/07/20
- [elpa] master 7feb14f 289/399: ivy.el (ivy-format-functions-alist): New defcustom, obsoletes ivy-format-function, Oleh Krehel, 2019/07/20
- [elpa] master b528f0f 299/399: ivy-overlay.el (ivy-display-function-overlay): Fix org-indent-mode once more, Oleh Krehel, 2019/07/20
- [elpa] master ef1e8d5 294/399: ivy.el (ivy-read): Don't use ivy-display-function, Oleh Krehel, 2019/07/20
- [elpa] master 57a57d1 302/399: swiper.el (swiper--multi-candidates): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 44b2d7d 300/399: ivy.el (ivy-insert-current-full): Add and bind to "C-M-y", Oleh Krehel, 2019/07/20
- [elpa] master d39f82b 307/399: counsel-yank-pop-height is obselete and doesn't do anything, Oleh Krehel, 2019/07/20
- [elpa] master c11797a 290/399: swiper.el (swiper--line-at-point): Fix swiper-isearch in compilation buffers, Oleh Krehel, 2019/07/20
- [elpa] master 94f107b 304/399: counsel.el (counsel-mark-ring): Add highlight by candidate,
Oleh Krehel <=
- [elpa] master 034f3af 306/399: swiper.el (swiper-isearch): Allow char-fold-to-regexp, Oleh Krehel, 2019/07/20
- [elpa] master 5cc1e5c 298/399: swiper.el (swiper-isearch-thing-at-point): Improve, Oleh Krehel, 2019/07/20
- [elpa] master 3b6c898 303/399: counsel.el (counsel-mark-ring): Add preview by candidate, Oleh Krehel, 2019/07/20
- [elpa] master 93616f7 296/399: ivy.el (ivy--regex): Match initial dot in the input as a literal dot, Oleh Krehel, 2019/07/20
- [elpa] master ac1e07c 305/399: ivy.el (ivy--reset-state): Modify prompt for multi-isearch-buffers, Oleh Krehel, 2019/07/20
- [elpa] master 4078eb9 308/399: counsel.el (counsel-yank-pop-height): Remove, Oleh Krehel, 2019/07/20
- [elpa] master 895906e 309/399: counsel.el (counsel-descbinds-function): Add, Oleh Krehel, 2019/07/20
- [elpa] master 4a37e1e 314/399: swiper.el (swiper-query-replace): Make eval-style replacement more accessible, Oleh Krehel, 2019/07/20
- [elpa] master dd2d495 312/399: swiper.el (swiper-all-thing-at-point): Add, Oleh Krehel, 2019/07/20
- [elpa] master 0576b61 315/399: .github/FUNDING.yml: Add, Oleh Krehel, 2019/07/20