lsp-treemacs icon indicating copy to clipboard operation
lsp-treemacs copied to clipboard

Possibility to remove the icons

Open Nathan-Furnal opened this issue 5 years ago • 12 comments

Hi,

I'm using lsp-treemacs and it added icons which I don't use at all in regular treemacs. How can I remove the icons and not use them?

Thanks!

Nathan-Furnal avatar Oct 02 '20 11:10 Nathan-Furnal

How did you disable the icons for regular treemacs? You can customize the icon theme of lsp-treemacs using the lsp-treemacs-theme variable, so perhaps you could set some icon theme that has no icons for it.

nbfalcon avatar Nov 05 '20 11:11 nbfalcon

In treemacs one can set a variable like this :

(setq treemacs-no-png-images t)

I'm not sure how changing the theme would affect the behavior of my current theme, it'd be just easier not to have them tbh

Nathan-Furnal avatar Nov 12 '20 16:11 Nathan-Furnal

If you are happy with sacrificing the arrows, I could offer the following (temporary!) kludge, until we actually implement this properly (so don't close this issue yet):

(eval-after-load 'lsp-treemacs (defun lsp-treemacs--generic-icon (&rest _) ""))

Here is how it would look on latest treemacs master + lsp-mode master: 20201112-180325

nbfalcon avatar Nov 12 '20 17:11 nbfalcon

That wouldn't be an issue for me ! This is how my treemacs looks for reference

Screenshot_20201112_180851 And like this when I "unroll" it :

Screenshot_20201112_181122

So that's just good old treemacs without any fluff aside from the symbols that indicate a different level in the tree structure.

Thanks for getting back to me!

Nathan-Furnal avatar Nov 12 '20 17:11 Nathan-Furnal

In treemacs one can set a variable like this :

(setq treemacs-no-png-images t)

I'm not sure how changing the theme would affect the behavior of my current theme, it'd be just easier not to have them tbh

I see that lsp-treemacs.el always calls treemacs-get-icon-value with second parameter nil. That second parameter indicates whether the TUI version of the icon should be used (when non-nil) or the GUI version (when nil). I may be wrong here as I'm not familiar with the treemacs code, or Emacs Lisp for that matter, but lsp-treemacs could take the value of treemacs-no-png-images into account. That it doesn't appear to do so may be by design, I don't know.

To disable the use of icons I locally replaced the nil in the call to treemacs-get-icon-value by treemacs-no-ping-images, which I've set to t. It works for the use case I have.

swinkels avatar Dec 29 '20 15:12 swinkels

@nbfalcon if implemented, would this proposed feature/switch also solve https://github.com/hlissner/emacs-doom-themes/issues/500? if not, shall i open a separate issue?

eeshugerman avatar Jan 14 '21 15:01 eeshugerman

No, that is unrelated (this is lsp-treemacs, not normal treemacs)

nbfalcon avatar Jan 15 '21 12:01 nbfalcon

The issue only appears once lsp-mode starts up, so I'm pretty sure it's an lsp-treemacs issue.

eeshugerman avatar Jan 15 '21 13:01 eeshugerman

Upon further inspection, this is probably related. Can you check with the triage/ugly-icons branch on my fork? Note that this is not a proper fix, and is only to find out if this is due to lsp-treemacs, as it will probably break lots of icons in the latter.

nbfalcon avatar Jan 15 '21 16:01 nbfalcon

it works! no icon issues present when i use that branch (none that i can see anyway, with the "doom-colors" theme; i don't mean to suggest it's not breaking other stuff as you mentioned).

eeshugerman avatar Jan 15 '21 17:01 eeshugerman

Great! So the issue here is that we are modifying the "Default" treemacs theme, and replacing some icons which were probably provided by all-the-icons with png icons. The former uses a font and so they are vector graphics and scale well, while the latter ones are raster graphics and don't. The icons that are needlessly overridden in lsp-treemacs-icons would need to be examined. Note that this is unrelated to this issue, though.

nbfalcon avatar Jan 15 '21 17:01 nbfalcon

got it :+1: i opened a new issue, see above

eeshugerman avatar Jan 15 '21 18:01 eeshugerman