From 3ab444689d761b0f86137805003f9e094096996d Mon Sep 17 00:00:00 2001 From: BardofSprites Date: Tue, 22 Jul 2025 17:02:33 -0400 Subject: cursor shape for text --- bard-elisp/bard-theme.el | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) -- cgit v1.2.3