diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-14 17:23:37 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-14 17:23:37 -0500 |
| commit | 7ccc3f5c0d688914eff0f8501f85d3f40ab8601d (patch) | |
| tree | 96c1669768a87345747a441fa3effd265d5a74b3 /modules/modeline-config.el | |
| parent | abaf96f1b4b9efc296161e2315549f55377740b4 (diff) | |
| download | dotemacs-7ccc3f5c0d688914eff0f8501f85d3f40ab8601d.tar.gz dotemacs-7ccc3f5c0d688914eff0f8501f85d3f40ab8601d.zip | |
refactor(ui): color the cursor and modeline from theme faces, in sync
The cursor color and the modeline buffer-name indicator both hard-coded hex colors through cj/buffer-status-colors. Replaced that constant with cj/buffer-status-faces, mapping each buffer state to a theme face: read-only to error, overwrite and modified to warning, unmodified to success. A shared classifier (cj/buffer-status-state) and resolver (cj/buffer-status-color) in user-constants now drive both consumers, so the cursor and the modeline resolve their color from the active theme at use time and stay in sync, including the ghostel-terminal case the cursor already special-cased. Tests cover the map, the classifier, the resolver, and both integration paths.
Diffstat (limited to 'modules/modeline-config.el')
| -rw-r--r-- | modules/modeline-config.el | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/modules/modeline-config.el b/modules/modeline-config.el index 21ecd7e47..f6b8ef4eb 100644 --- a/modules/modeline-config.el +++ b/modules/modeline-config.el @@ -75,12 +75,7 @@ Example: `my-very-long-name.el' → `my-ver...me.el'" ;; -------------------------- Modeline Segments -------------------------------- (defvar-local cj/modeline-buffer-name - '(:eval (let* ((state (cond - (buffer-read-only 'read-only) - (overwrite-mode 'overwrite) - ((buffer-modified-p) 'modified) - (t 'unmodified))) - (color (alist-get state cj/buffer-status-colors)) + '(:eval (let* ((color (cj/buffer-status-color (cj/buffer-status-state))) (name (buffer-name)) (truncated-name (cj/modeline-string-cut-middle name))) (propertize truncated-name |
