aboutsummaryrefslogtreecommitdiff
path: root/bard-elisp/bard-theme.el
diff options
context:
space:
mode:
Diffstat (limited to 'bard-elisp/bard-theme.el')
-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)