aboutsummaryrefslogtreecommitdiff
path: root/init.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-14 02:25:19 -0600
committerCraig Jennings <c@cjennings.net>2025-11-14 02:25:19 -0600
commit014afdcfe72fd8a3d5c58b650c4742aff178ee60 (patch)
tree36d72345c3a7b05e2ca008109f57c95311e81d0d /init.el
parent48d9f1e416a6327c7d27c4501651ed1410c53e96 (diff)
downloaddotemacs-014afdcfe72fd8a3d5c58b650c4742aff178ee60.tar.gz
dotemacs-014afdcfe72fd8a3d5c58b650c4742aff178ee60.zip
fix(ui): Fix cursor color updates with post-command-hook
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
Diffstat (limited to 'init.el')
-rw-r--r--init.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.el b/init.el
index 17d5e3153..cb84f9858 100644
--- a/init.el
+++ b/init.el
@@ -56,7 +56,7 @@
(require 'font-config) ;; font and emoji configuration
(require 'selection-framework) ;; menu config
(require 'modeline-config) ;; modeline (status-bar) config
-(require 'mousetrap-mode) ;; disables trackpad/mouse input only in Emacs
+(require 'mousetrap-mode) ;; prevent accidental mouse/trackpad modifications
(require 'popper-config) ;; moving logs, help, and other buffers to popup
;; ----------------- Emacs Built-In Functionality Configuration ----------------