Open CSRaghunandan opened 4 years ago
I noticed this as well, which is why I haven't closed the issue for this feature yet. On my linux it works fine, but on my macos I either see no guides or uncolored guides depending on which distribution of emacs I test it on.
My intuition is that it has to do with the way XPM images are handled, as emacs needs an external library to use that format, and it might not treat the format properly depending on how the system deals with that requirement (this is vague and might be wrong, I don't know much about how it works in detail). To test this I changed it to use PBM images instead, which seems to work fine everywhere, but currently the implementation is optimized for XPM and is therefore very slow for PBM (especially when using tabs rather than spaces). I've been meaning to find the time to reoptimize the new code so I can release it, and hopefully once that's done it'll work better for you.
There might be a conflict between setting highlight-indent-guides-method via M-x customize-... or via setq. Suggest to rely on customizing, which would require updating the docs.
@andreas-roehler I'm getting the same results with customize as I do with setq, I didn't realize there was much of a difference. Is yours working better with customize, then?
This was a rather abstract reasoning, powered by the fact that also the README suggests the use of setq. Problem arises as both setting might provide different values (race condition). Will open a separate issue for it relating to README and discouraging the use of setq.
@DarthFennec not sure if it matters, but I'm experiencing this issue on Linux (no bitmap image) on Ubuntu 20.04. Which distribution are you using?
@dleal-mojotech I'm using Arch. Perhaps there's some difference in our environments: emacs uses a library for XPM support, so maybe you don't have that library or have a different build of it that's not entirely compatible or something. Once I get PBM support in everyone should be able to use it, but I still haven't found time to finish the implementation, I'll let you know when I do though.
Okay, I finally had time to fix it to use PBM. Let me know what you guys think.
This is working now, thanks! The only wrinkle I see is that customizing highlight-indent-guides-bitmap-function
to highlight-indent-guides--bitmap-line
, still shows the dots instead of a line. Here's how it looks:
and here's my configuration:
(use-package highlight-indent-guides
:ensure t
:hook ((prog-mode . highlight-indent-guides-mode)
(yaml-mode . highlight-indent-guides-mode))
:custom
(highlight-indent-guides-method 'bitmap)
(highlight-indent-guides-responsive 'top)
(highlight-indent-guides-bitmap-function 'highlight-indent-guides--bitmap-line))
Sorry, another difference I noticed is that using character
is still significantly faster than using bitmap
.
The former might be a caching issue, I'll look into it. Does it still use dots after you restart emacs completely? Or is it just after changing and reloading your config?
I optimized it as much as I could, but yeah, it's definitely slower than character
(especially in files with tab indents). I'll see if I can find any other optimizations I can make, but I think it's just going to be the slowest of the bunch regardless, and I don't think there's much we can do about it.
@DarthFennec my apologies for taking so long to reply, but given the performance difference, I reverted the method to character
and forgot about it. I tried restarting Emacs, and it does work if I set the bitmap function to highlight-indent-guides--bitmap-line
.
When I enable bitmap method, and restart
highlight-indent-gudies
, I don't see the indent guides anymore. I'm not sure what is going on. I tried using different themes just to make sure my theme configuration was not messing it up, but still the issue persisted.I can even reproduce the issue in
emacs -Q
: (package-initialize) (setq highlight-indent-guides-method 'bitmap) open any file and enablehighlight-indent-guides-mode