Skip to content

Commit

Permalink
Merge pull request Malabarba#168 from lyro/master
Browse files Browse the repository at this point in the history
Consider separators in computation of maximal mode width
  • Loading branch information
Malabarba committed Jan 20, 2016
2 parents 25db875 + c0053cf commit 9002cb1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions smart-mode-line.el
Original file line number Diff line number Diff line change
Expand Up @@ -1520,11 +1520,15 @@ duplicated buffer names) from being displayed."
(let* (;; The minor-mode-alist
(nameList (rm--mode-list-as-string-list))
;; The size available
(size (if (member sml/mode-width '(full right))
;; Calculate how much width is available
(sml/fill-width-available)
;; or use what the user requested.
sml/mode-width))
(size (- (if (member sml/mode-width '(full right))
;; Calculate how much width is available
(sml/fill-width-available)
;; or use what the user requested.
sml/mode-width)
(string-width (format-mode-line
'sml/pre-minor-modes-separator))
(string-width (format-mode-line
'sml/pos-minor-modes-separator))))
;; Used for counting size.
(finalNameList (mapconcat 'identity nameList ""))
needs-removing filling)
Expand All @@ -1546,11 +1550,7 @@ duplicated buffer names) from being displayed."
(add-to-list 'nameList sml/propertized-shorten-mode-string t))

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

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

0 comments on commit 9002cb1

Please sign in to comment.