From 547c37398bf0332f28adf11f54e12ff77e153e66 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 26 Mar 2026 15:10:51 -0700 Subject: [PATCH] Keep the cursor at the beginning of the overlay Before: the cursor jumps to the end of the overlay. Now: the cursor stays where it is, and the proposed text comes after the cursor. --- wingman.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wingman.el b/wingman.el index 3cfcae5..16e6a8c 100644 --- a/wingman.el +++ b/wingman.el @@ -713,7 +713,12 @@ If POS-MARKER is non-nil, render at that marker position." (setcar (last accept-content-lines) (concat (car (last accept-content-lines)) current-suffix))) - (overlay-put first-ov 'after-string (propertize display-first-line 'face 'wingman-overlay-face)) + (let* ((text display-first-line) + (len (length text))) + (put-text-property 0 1 'cursor len text) + (put-text-property 0 len 'face 'wingman-overlay-face text)) + + (overlay-put first-ov 'after-string display-first-line) (overlay-put first-ov 'wingman t) (setq wingman--hint-overlay first-ov)