aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardofSprites <[email protected]>2025-07-22 17:02:33 -0400
committerBardofSprites <[email protected]>2025-07-22 17:02:33 -0400
commit3ab444689d761b0f86137805003f9e094096996d (patch)
treed5b539ed5fce75c0f17d56a6f746e7a89b9c3846
parent60ade8cea568f94ac115f1712837592abaac9803 (diff)
cursor shape for text
-rw-r--r--bard-elisp/bard-theme.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/bard-elisp/bard-theme.el b/bard-elisp/bard-theme.el
index 9f0aa6b..41396a1 100644
--- a/bard-elisp/bard-theme.el
+++ b/bard-elisp/bard-theme.el
@@ -85,4 +85,15 @@
(setq ryo-modal-cursor-color cursor-color
ryo-modal-default-cursor-color cursor-color))))
+(defvar my-last-cursor-type nil)
+
+(defun bard/update-cursor-type ()
+ "Set cursor type to 'bar in text modes, 'box otherwise."
+ (let ((new-cursor (if (derived-mode-p 'text-mode) 'bar 'box)))
+ (unless (eq my-last-cursor-type new-cursor)
+ (setq cursor-type new-cursor)
+ (setq my-last-cursor-type new-cursor))))
+
+(add-hook 'post-command-hook #'bard/update-cursor-type)
+
(provide 'bard-theme)