Decouple :modeline popup rule from modeline API
The :modeline property still takes: t => default modeline nil => no modeline (the default) But now also accepts: function => uses its return value as the mode-line-format anything non-nil => used directly as the mode-line-format This is to decouple the popup API from the modeline API. You can still use them compositionally: (set-popup-rule "abc" :modeline (lambda () (set-modeline! :project)))
This commit is contained in:
parent
cb7e471c90
commit
1205db0f73
3 changed files with 19 additions and 19 deletions
|
@ -140,10 +140,9 @@
|
|||
(display-buffer a)
|
||||
(expect mode-line-format :to-equal (default-value 'mode-line-format)))
|
||||
(it "uses a predefined mode-line if passed a symbol"
|
||||
(def-modeline! test-popup-modeline ("x") ())
|
||||
(set-popup-rule! "a" :modeline 'test-popup-modeline :select t)
|
||||
(set-popup-rule! "a" :modeline '("x") :select t)
|
||||
(display-buffer a)
|
||||
(expect mode-line-format :to-equal (doom-modeline 'test-popup-modeline)))
|
||||
(expect mode-line-format :to-equal '("x")))
|
||||
(it "runs the handler if passed a function"
|
||||
(set-popup-rule! "a" :modeline (lambda () (setq mode-line-format '("x"))) :select t)
|
||||
(display-buffer a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue