mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-27 11:09:52 +00:00
Improve: Watch buffer-read-only.
This commit is contained in:
parent
ee2aa11bbe
commit
4b22534199
1 changed files with 7 additions and 0 deletions
|
@ -214,6 +214,7 @@ It returns a file name which can be used directly as argument of
|
||||||
(declare-function symbol-overlay-assoc 'symbol-overlay)
|
(declare-function symbol-overlay-assoc 'symbol-overlay)
|
||||||
(declare-function symbol-overlay-get-list 'symbol-overlay)
|
(declare-function symbol-overlay-get-list 'symbol-overlay)
|
||||||
(declare-function symbol-overlay-get-symbol 'symbol-overlay)
|
(declare-function symbol-overlay-get-symbol 'symbol-overlay)
|
||||||
|
(declare-function undo-tree-redo 'undo-tree)
|
||||||
(declare-function undo-tree-undo 'undo-tree)
|
(declare-function undo-tree-undo 'undo-tree)
|
||||||
(declare-function window-numbering-clear-mode-line 'window-numbering)
|
(declare-function window-numbering-clear-mode-line 'window-numbering)
|
||||||
(declare-function window-numbering-get-number-string 'window-numbering)
|
(declare-function window-numbering-get-number-string 'window-numbering)
|
||||||
|
@ -798,6 +799,12 @@ buffer where knowing the current project directory is important."
|
||||||
(advice-add #'narrow-to-region :after #'doom-modeline-update-buffer-file-state-icon)
|
(advice-add #'narrow-to-region :after #'doom-modeline-update-buffer-file-state-icon)
|
||||||
(advice-add #'widen :after #'doom-modeline-update-buffer-file-state-icon)
|
(advice-add #'widen :after #'doom-modeline-update-buffer-file-state-icon)
|
||||||
|
|
||||||
|
(add-variable-watcher
|
||||||
|
'buffer-read-only
|
||||||
|
(lambda (_sym val op _where)
|
||||||
|
(when (and (eq op 'set) (eq val nil))
|
||||||
|
(doom-modeline-update-buffer-file-state-icon))))
|
||||||
|
|
||||||
(defvar-local doom-modeline--buffer-file-name nil)
|
(defvar-local doom-modeline--buffer-file-name nil)
|
||||||
(defun doom-modeline-update-buffer-file-name (&rest _)
|
(defun doom-modeline-update-buffer-file-name (&rest _)
|
||||||
"Update buffer file name in mode-line."
|
"Update buffer file name in mode-line."
|
||||||
|
|
Loading…
Reference in a new issue