alphapapa / topsy.el

Simple sticky header showing definition beyond top of window
GNU General Public License v3.0
100 stars 6 forks source link

Hide header-line when at the top of the buffer #19

Open andreyorst opened 1 day ago

andreyorst commented 1 day ago

This is more of a proof of concept of an attempt to solve the #1 issue.

With these changes, the header-line is given the same color as the buffer, and it's line height is set to 0.1 making it almost invisible. If the window-start is equal to 1 there's no header-line. Otherwise, topsy works as before.

Here's a demonstration:

https://github.com/user-attachments/assets/33cbfad7-d8aa-413e-848b-b734e921b4ae

(I intend to use this fork for myself, so I added some extra decorations to the header line, so if you're willing to accept this PR, I would remove any decorations you deem unnecessary. Or we could think of a way of allowing tweaking the topsy-header-line-format.)

alphapapa commented 1 day ago

Hi Andrey,

I've tried to do something like this in the past, but it was complicated, and it felt jarring to the user for the header line to appear and disappear. I'm not sure if I want to go this route.

My suggestion is that you continue using it in a fork for a month or so and then let me know how you feel about it then. If you're still enjoying it, then it's probably worth considering seriously. :)

Thanks.

andreyorst commented 1 day ago

I've tried to do something like this in the past, but it was complicated, and it felt jarring to the user for the header line to appear and disappear. I'm not sure if I want to go this route.

Just added a video demonstration to the ticket.

My suggestion is that you continue using it in a fork for a month or so and then let me know how you feel about it then. If you're still enjoying it, then it's probably worth considering seriously. :)

Sure! Though, I can confidentely say, that the approach I took is a bit destructive, as it affects the headerline in all windows, regardles if topsy-mode is active in those. So this is more of a proof of concept, and maybe someone with better elisp skills would be able to find a better way to do it.

alphapapa commented 1 day ago

Thanks, that video helps a lot. It looks pretty good with the pixel-scrolling (which I don't generally use myself).

Yeah, it would need to only affect the window displaying the buffer.

Good food for thought, regardless. :)