rainstormstudio / treemacs-nerd-icons

GNU General Public License v3.0
19 stars 10 forks source link

Support `lsp-treemacs` (Some icons are misaligned) #1

Open bricka opened 1 year ago

bricka commented 1 year ago

I'm trying out the package for the first time, and I noticed that in my Treemacs, a number of lines are misaligned. For directories, the arrow also vanishes.

Here's an example of the build directory looking out of place: image

It also happens for some files: image

Thank you!

il-santo commented 1 year ago

Same problem here: immagine

rainstormstudio commented 1 year ago

That looks like the misaligned icons are not using nerd icons (as nerd icons are monocolored icons). Anyway, this could be caused by other bugs from treemacs-nerd-icons. Currently this package has several bugs, and I will fix them as soon as possible.

il-santo commented 1 year ago

Turned out it was lsp-treemacs! I removed it and all worked well. But it is a dependency od DAP, so if there is a way to overwrite the icons settings (or the theme) of lsp-treemacs it would be very nice!

rainstormstudio commented 1 year ago

Could you please check if 5b09f58e48658328d35e65538224a860fa777496 fixes this?

il-santo commented 1 year ago

Nope. Same problem.

bricka commented 1 year ago

I was able to address some of the issues here: https://github.com/rainstormstudio/treemacs-nerd-icons/pull/3

il-santo commented 1 year ago

Nope, still same problem, for me.

bricka commented 1 year ago

So, I believe the issue is that in certain cases, we are showing the icon from the default Treemacs theme, which causes the misalignment. There are two cases:

  1. Wrong icons displayed for certain directories. I think this is related to https://github.com/Alexander-Miller/treemacs/issues/1016. Interestingly, if i use treemacs-modify-theme to update the icons, that works, but adding them to the base theme, as in #3, isn't working. Hrm.
  2. https://github.com/rainstormstudio/nerd-icons.el is missing an icon for certain files, e.g. .editorconfig. This causes us to not overwrite the icon, so we fallback to the default Treemacs one.
lassemaatta commented 1 year ago

Just in case this helps anyone else: I noticed that if I specify (setq treemacs-no-png-images t) when loading treemacs then the misaligned directory icons from lsp-treemacs are replaced with +. It's not perfect, but at least it looks a bit cleaner.

ahmetrehaseker commented 11 months ago

I had the same issue, when I checked variables I saw that icons are stored in hash table. When creating new icons if the keys are collide it override it. The problem is in the extensions part. Original theme hash contains "src-dir" but you are adding src-dir those 2 are stored in hash separately so that is why this https://github.com/rainstormstudio/treemacs-nerd-icons/pull/3 change does not fix the problem.

JimMoen commented 9 months ago

load treemacs-nerd-icons after lsp-treemacs solved the problem. See load-after-lsp-treemacs

Before:


After: