rougier / nano-vertico

Emacs / nano + vertico
GNU General Public License v3.0
42 stars 1 forks source link

Non breaking space renders an underline #1

Open Cons-Cat opened 8 months ago

Cons-Cat commented 8 months ago

Unlike the image in the readme, on my configuration the buffer looked like this: image

There is no arrow on the current line, and each line has an underline behind it. I have fixed the underline by redefining nano-vertico--format-candidate in my init.el to insert only a normal whitespace instead like so:

(defun nano-vertico--format-candidate (orig-fun cand prefix suffix index start)
  (apply orig-fun (list (nano-vertico--format-string cand)
                        (nano-vertico--format-string (concat " " prefix))
                        (nano-vertico--format-string suffix)
                        index start)))

I don't know where the arrow is supposed to come from, though.

rougier commented 8 months ago

you can use (with Nerd font):

(defun nano-vertico--format-candidate (orig-fun cand prefix suffix index start)
  "Make sure CAND, PREFIX and SUFFIX have height set because the
default face height is set to 0.1 to hide regular prompt/contents"

  (apply orig-fun (list (nano-vertico--format-string cand)
                        (nano-vertico--format-string (if (= vertico--index index) " " "  "))
                        (nano-vertico--format-string suffix)
                        index start)))
Cons-Cat commented 8 months ago

Thanks for the tip! I don't have a nerd font, so I set it to this cute heart instead: image Maybe the arrow character would make a good configuration point.

rougier commented 8 months ago

I tried several regular character such as >, ▶︎, , but the one from Nerd font was better. Where does the heart come from? Regular font ?

Cons-Cat commented 8 months ago

I got it from here: https://emojipedia.org/rotated-heavy-black-heart-bullet It's part of unicode 1.1 apparently, so I guess it's in some font on my system. Likely noto fonts.