Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customizable faces for header line, and improved display logic
* Add two new customizable faces, topsy and topsy-highlight. The topsy face is used for the header-line face when topsy-mode is enabled. It inherits from the default face, so that the text in the header line matches the contents of the buffer. The topsy-highlight face is applied (with low priority) when topsy is showing the first line of a defun (see below). To go back to the previous appearance (using header-line face), customize the topsy face to nil or remove its ":inherit default" attribute. * Properly handle narrowed buffers The first line of the defun is shown even if it is only partly within a narrowed buffer. * Improve logic for finding the first line of a defun The first line of a defun is shown only if it is partially visible. If the defun is entirely outside the window, its first line is not shown. Fixes alphapapa#1 * Show previous line when a defun starts at the top of a window Finally, when there is no partially visible defun, show the line that is above the top of the window. This gives a smooth scrolling effect, where the header line looks and acts just like a normally scrolling part of the buffer. When you scroll up, the top line of text will appear in the header line, which then becomes sticky when you scroll past a defun. Buffer text shown in this way doesn't have the topsy-highlight face.
- Loading branch information