altsem / gitu

A TUI Git client inspired by Magit
MIT License
1.65k stars 86 forks source link

option to change bar character for non-nerd fonts #207

Closed mattly closed 1 week ago

mattly commented 1 week ago

The bar character used to highlight the current line does not render in any of the non-nerd fonts I use. I instead get the "missing unicode" character similar to https://github.com/altsem/gitu/issues/80

I, personally, don't like the way nerd fonts render darker than the unpatched variant of the same, and most of time I'm using a commercially-available monospace font which I would have to (and haven't) patched with the nerd icons manually.

I'd rather have an option for gitu to use a different character. I would probably go with ▸ BLACK RIGHT-POINTING SMALL TRIANGLE but given that different fonts render these things so differently, it might be nice to leave these up to the individual person.

EDIT: just saw #83 ; this is weird. I'm running gitu from homebrew, version eed0301-modified, so I suspect brew hasn't gotten the new version yet.

mattly commented 1 week ago

ok, when I install from cargo, it renders fine. I'm not sure what's up with homebrew being out of date, but the request for a customization option still stands, as the bar character looks funny in some fonts. Perhaps then also an option to customize the "sub-bar" character as well.

image image
altsem commented 1 week ago

I've been thinking of this :) It's easy to add, so I did it! Fonts are confusing to me too, it seems some fonts just don't include certain symbols.

The PR I linked makes the symbol configurable:

cursor = { symbol = "▌", fg = "blue" }
selection_bar = { symbol = "▌", fg = "blue", mods = "DIM" }

Could be a start!

mattly commented 1 week ago

wonderful, thanks!