rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 195 forks source link

fix header-line #16

Closed guiyuanju closed 3 years ago

guiyuanju commented 3 years ago

Fixed bugs: The length of header-line will change along with:

  1. the body font size changes

    image
  2. the window-body-size changes

    image

How did fix it:

  1. the font size in header-line is always fixed when the font size in body changed, but the computation of the length of header-line uses the body font size: (window-font-width nil 'default) I changed it to header-line: (window-font-width nil 'header-line)

  2. there are some modes change the window margin and width to center text, but the computation of the length of header-line rely on the window-body-size, which sometimes changes in some modes, so replaced the window-body-size to window-total-size, and subtract the right divider width (/ (window-right-divider-width) char-width)

rougier commented 3 years ago

Clever. Thanks.