Closed suyashbire1 closed 6 years ago
Just added this as telephone-line-hud-segment
(it's built on top of a separator object, so it should also work as a separator using telephone-line-hud
if you want... but that's kinda silly :P)
Oh right, do keep in mind, though, that it'll negatively affect scrolling performance. Normally, separators are initialized on (or near) startup (the first time they're rendered, they're saved into a cache) -- but since this one shows a whole ton of different possible images, each one is added to the cache the first time you, for example, scroll 50% down a buffer on which you can see 20% of the screen. It's all still cached, but it'll be slower the first time you scroll through a file after a cold start.
(it'll also be significantly more demanding than anything else in terms of memory due to said cache; it's O(n^3)
, but n
in this case is the vertical height of your font, so it is still bounded pretty low. I'll need to see if I can limit the number of entries in the hash)
Thank you for this! Just tried it out and it works like a charm!
I did not notice any degradation of scrolling performance. It was perhaps imperceptible if there was any. Also, I have nlinum and nlinum-relative installed which slow down scrolling too, so hud segment's slowdown might be masked by them.
I'll keep an eye on its memory usage and report if I notice anything abnormal.
Going to close this now; feel free to reopen if any of those potential issues turn out to be disruptive.
The following hud-segment is stolen from https://github.com/milkypostman/powerline/blob/master/powerline.el#L268. Would it be possible to adapt it for telephone-line?