completion/ivy: show chevron on highlighted item in tty
So its easier to see in the terminal, where some themes may not have a visible background for the current match.
This commit is contained in:
parent
f686e01f4b
commit
db7b2f6da9
2 changed files with 21 additions and 1 deletions
|
@ -77,6 +77,26 @@ Buffers that are considered unreal (see `doom-real-buffer-p') are dimmed with
|
|||
((format "%s" val)))
|
||||
t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +ivy-format-function-line-or-arrow (cands)
|
||||
"Transform CANDS into a string for minibuffer.
|
||||
|
||||
If in terminal, prefix candidates with a chevron to make it more obvious which
|
||||
one you're selecting, especially in themes that can't set a good background for
|
||||
`ivy-current-match'. This is a combination of `ivy-format-function-line' and
|
||||
`ivy-format-function-arrow'.
|
||||
|
||||
In the GUI, this is the same as `ivy-format-function-line'."
|
||||
(if (display-graphic-p)
|
||||
(ivy-format-function-line cands)
|
||||
(ivy--format-function-generic
|
||||
(lambda (str)
|
||||
(ivy--add-face (concat "> " str "\n") 'ivy-current-match))
|
||||
(lambda (str)
|
||||
(concat " " str "\n"))
|
||||
cands
|
||||
"")))
|
||||
|
||||
|
||||
;;
|
||||
;; Library
|
||||
|
|
|
@ -69,7 +69,7 @@ results buffer.")
|
|||
;; Highlight each ivy candidate including the following newline, so that it
|
||||
;; extends to the right edge of the window
|
||||
(setf (alist-get 't ivy-format-functions-alist)
|
||||
#'ivy-format-function-line)
|
||||
#'+ivy-format-function-line-or-arrow)
|
||||
|
||||
;; Integrate `ivy' with `better-jumper'; ensure a jump point is registered
|
||||
;; before jumping to new locations with ivy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue