Skip to content

Commit

Permalink
Consider minor mode separators in computation of fill string
Browse files Browse the repository at this point in the history
The the variables `sml/pre-minor-modes-separator` and
`sml/pos-minor-modes-separator` both contribute to the minor-modes
string. Therefore their sizes must be taken into account when
computing the fill string, too, otherwise the resulting fill string
and the complete modeline string will be too large (e.g. for powerline
theme).
  • Loading branch information
f-fr committed Jan 11, 2016
1 parent 4b3265e commit 0cb1352
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion smart-mode-line.el
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,11 @@ duplicated buffer names) from being displayed."
(add-to-list 'nameList sml/propertized-shorten-mode-string t))

;; Padding
(setq filling (- size (length (format-mode-line nameList))))
(setq filling (- size (length (format-mode-line
(list ""
'sml/pre-minor-modes-separator
nameList
'sml/pos-minor-modes-separator)))))
(setq filling (make-string (max 0 filling) sml/fill-char))

(if (eq sml/mode-width 'right)
Expand Down

0 comments on commit 0cb1352

Please sign in to comment.