diff --git a/modules/completion/ivy/autoload/ivy.el b/modules/completion/ivy/autoload/ivy.el index 82e305f2f..6a18bc763 100644 --- a/modules/completion/ivy/autoload/ivy.el +++ b/modules/completion/ivy/autoload/ivy.el @@ -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 diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 899e6f771..2536a35e0 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -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