Skip to content

Commit

Permalink
fix: format error in earlier Emacs version (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiennq committed Mar 9, 2020
1 parent aece47d commit 4d97bf3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mini-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,16 @@ When ARG is:
mini-modeline-right-padding)
0))
(required-width (string-width right)))
;; (mini-modeline--log "a:%s r:%s\n" available-width required-width)
(if (< available-width required-width)
(if mini-modeline-truncate-p
(cons
(format (format "%%s %%%1$d.%1$ds" available-width) left right)
;; Emacs 25 cannot use position format
(format (format "%%s %%%d.%ds" available-width available-width) left right)
0)
(cons
(format (format "%%%1$d.%1$ds\n%%s" (- (frame-width mini-modeline-frame)
mini-modeline-right-padding))
right left)
(let ((available-width (+ available-width (string-width left))))
(format (format "%%0.%ds\n%%s" available-width) right left))
1))
(cons (format (format "%%s %%%ds" available-width) left right) 0))))

Expand Down

0 comments on commit 4d97bf3

Please sign in to comment.