casouri / vundo

Visualize the undo tree.
413 stars 20 forks source link

Tree branches not properly aligned, branch doesn't start at branching point #109

Open fapdash opened 1 week ago

fapdash commented 1 week ago

Somehow the branches of my vundo tree don't align properly, this happens with utf8 glyphs, as well as with default ascii:

With unicode-symbols (keycast output in tab-bar)

https://github.com/casouri/vundo/assets/459631/a38b93b1-529f-4bf9-8ac5-a1acff016add

ascii with Symbola font family

https://github.com/casouri/vundo/assets/459631/c52f452f-97a8-4dcc-b36b-0dc22c5f8df5

ascii with Ubuntu font family

https://github.com/casouri/vundo/assets/459631/32393562-0e31-4b26-a620-127391e25812

My config:

(use-package vundo
  :ensure t
  :config
  (setq vundo-glyph-alist vundo-unicode-symbols)
  (set-face-attribute 'vundo-default nil :family "Symbola")
  (global-set-key (kbd "C-x u") 'vundo))

Do you have any idea why this would be happening? Anything I could do to help with debugging this issue?

casouri commented 6 days ago

You need to use a monospace font for both ascii and unicode. Ascii is easier since most programming font are monospace; for unicode, you need to find a monospace font that has those glyphs. I use pragmata pro but it's paid. You can find what font is Emacs using for a character in a buffer by moving point over it and type C-u C-x =.

fapdash commented 6 days ago

Are there versions of Symbola that contain a monospaced version that I could find? I'm a bit confused since Symbola gets recommended in the README.

I then also ran into an issue where some of the glyphs where using Ubuntu Mono and some where using Fira Code. What worked for me was this, with nerd-fonts installed via nerd-fonts.el:

(set-face-attribute 'vundo-default nil :font "FiraCode Nerd Font Mono" :family "FireCode Nerd Font")
casouri commented 5 days ago

Actually, I don't quite remember why I mentioned Symbola in the README 😅 Thanks for pointing that out, I probably should remove its mention. Nerd font looks good, you figured it out quite well!

fapdash commented 5 days ago

Thank you for your guidance and the great package! :)