Skip to content

Commit

Permalink
Merge pull request Malabarba#181 from mola-T/master
Browse files Browse the repository at this point in the history
Solve args-out-of-range by ensuring positive 'size' in sml/generate-minor-modes
  • Loading branch information
Malabarba committed May 6, 2016
2 parents 9715b51 + 5d3dc38 commit 8fd76a6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions smart-mode-line.el
Original file line number Diff line number Diff line change
Expand Up @@ -1523,15 +1523,16 @@ 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)
(string-width (format-mode-line
'sml/pre-minor-modes-separator))
(string-width (format-mode-line
'sml/pos-minor-modes-separator))))
(size (max 0
(- (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 Down

0 comments on commit 8fd76a6

Please sign in to comment.