| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- popper-config.el: move `(popper-mode +1)` and `(popper-echo-mode
+1)` from the use-package `:init` block into `:config`.
`:disabled t' on use-package skips `:config' but still runs
`:init', so the previous shape enabled popper-mode on every load,
including batch / test runs, despite the disabled marker.
- modeline-config.el: make `cj/modeline-vc-fetch' fall back when
the internal `vc-git--symbolic-ref' is missing. `require' uses
`nil 'noerror', the call sits inside an `fboundp' guard, and
`ignore-errors' wraps the call itself so an Emacs version that
renames or removes the accessor leaves `branch' at
`vc-working-revision''s output instead of crashing the modeline.
- ui-config.el: guard the cursor-color `post-command-hook' behind
`(display-graphic-p)' both at install time and inside the
function body. Batch / TTY runs short-circuit cleanly with no
per-command overhead. A `server-after-make-frame-hook' catches
the daemon case where the first GUI frame is created after
ui-config loads and installs the hook lazily. Updates
test-ui-config--buffer-cursor-state and
test-ui-cursor-color-integration to stub `display-graphic-p' so
the work body still runs under batch.
- nerd-icons-config.el: drop `:demand t' (`:defer t' now), keeping
the `:config' advice install as the natural lazy-on-load path.
Add a `with-eval-after-load 'nerd-icons' block as a safety net for
the already-loaded case on re-eval; the block uses `advice-member-p'
so the advice never stacks.
|
|
|
The cursor color was not updating correctly when switching buffers
or modifying files. The original implementation used window-buffer-change
and other specific hooks, but these were insufficient and internal
buffers were interfering with cursor color updates.
Root cause:
- Cursor color is global (one cursor for all of Emacs)
- Previous hooks fired in internal buffer contexts (*Echo Area*, *temp*)
- This caused cursor to be set to white (unmodified) even when in
read-only buffers like dashboard
Solution:
- Use post-command-hook which runs after every command in current buffer
- Ignore internal buffers (names starting with space)
- Cache optimization prevents redundant set-cursor-color calls
Behavior now:
- Dashboard (read-only): Red cursor
- Unmodified file: White cursor
- Modified file: Green cursor
- After save: White cursor
Tests:
- Added 9 integration tests in test-ui-cursor-color-integration.el
- Tests verify hook installation, buffer switching, modification tracking
- All 27 tests passing (18 unit + 9 integration)
Integration tests catch issues that unit tests miss:
- Unit tests verified state detection logic (✓)
- Integration tests verify hooks fire at right times (✓ now)
- Integration tests verify real buffer switching behavior (✓ now)
Cleanup:
- Removed debug code from init.el
- Removed debug-cursor-color.el temporary file
|