fix bug mode-line not reset after multiple invocations
Fix a bug where the mode-line would not get rid of or regain the winum segment after winum-mode being activated several times non-interactively and then deactivated.
This commit is contained in:
parent
6f0c451799
commit
a096da2881
8
winum.el
8
winum.el
|
@ -418,7 +418,9 @@ POSITION: position in the mode-line."
|
||||||
(push winum--mode-line-segment res))
|
(push winum--mode-line-segment res))
|
||||||
(while mode-line
|
(while mode-line
|
||||||
(push (pop mode-line) res))
|
(push (pop mode-line) res))
|
||||||
(setq-default mode-line-format (nreverse res)))
|
(let ((nres (nreverse res)))
|
||||||
|
(setq mode-line-format nres)
|
||||||
|
(setq-default mode-line-format nres)))
|
||||||
(force-mode-line-update t))
|
(force-mode-line-update t))
|
||||||
|
|
||||||
(defun winum--clear-mode-line ()
|
(defun winum--clear-mode-line ()
|
||||||
|
@ -430,7 +432,9 @@ POSITION: position in the mode-line."
|
||||||
(unless (equal item winum--mode-line-segment)
|
(unless (equal item winum--mode-line-segment)
|
||||||
(push item res)))
|
(push item res)))
|
||||||
(pop mode-line))
|
(pop mode-line))
|
||||||
(setq-default mode-line-format (nreverse res)))
|
(let ((nres (nreverse res)))
|
||||||
|
(setq mode-line-format nres)
|
||||||
|
(setq-default mode-line-format nres)))
|
||||||
(force-mode-line-update t))
|
(force-mode-line-update t))
|
||||||
|
|
||||||
(defun winum--update ()
|
(defun winum--update ()
|
||||||
|
|
Loading…
Reference in a new issue