alphapapa / topsy.el

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

Use header as extra text line when there is no sticky header #18

Open roshanshariff opened 10 months ago

roshanshariff commented 10 months ago

When the topsy-mode-functions fail to return a sticky header (as with PR #17 when the top of the window is not in a defun), use the header as an extra line displaying the contents of the buffer immediately above the window. This fallback can be disabled with the new topsy-previous-line-fallback option.

Together with PR #17, this fixes bug #1 and supercedes #13.

This PR also introduces a new topsy-highlight face which is applied to the header line text whenever it is an actual sticky header, not just the line above the window. By default, it is fairly subtle but does the job of telling you what you're seeing, without being too jarring as you scroll through the buffer.

When combined with PR #16, the extra line of text is shown just like the rest of the buffer text, but sticky headers are slightly emphasized. The effect can be seen in the video attached to #7.

This is the third and last in a series of PRs that splits apart the functionality of #7. The combined effect can be seen in https://github.com/roshanshariff/topsy.el/tree/master.

https://user-images.githubusercontent.com/552952/140688151-e99393ce-433d-4885-9e1d-d3001faddb72.mp4

roshanshariff commented 9 months ago

Thanks for the feedback! I've changed the commits to address your comments.

alphapapa commented 9 months ago

Thank you. As I mentioned on the other PR, if you don't mind, I'll revisit this in the (hopefully near) future when I'm ready to work on v0.2.

failable commented 8 months ago

Pretty neat feature!