branch: elpa/gptel
commit 6ad0a019addfef114ab272222c586148add57e6d
Author: Tim Ruffing <[email protected]>
Commit: Karthik Chikmagalur <[email protected]>
gptel-rewrite: Deactivate mark only after command
* gptel-rewrite.el (gptel--rewrite-read-message): Set the
`deactivate-mark' variable instead of calling the
`deactivate-mark' function. This asks Emacs to deactivate the mark
after the command, which is in line with other editing commands.
This fixes an interaction with evil's visual selection mode, which
reads the deactivate-mark variable in post-command-hook in order
to determine whether to exit visual selection mode and adjust the
cursor position accordingly.
This is related to #870 but that issue is about a bug that can be
reproduced even without evil-mode, so this commit doesn't resolve
this issue ultimately.
---
gptel-rewrite.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gptel-rewrite.el b/gptel-rewrite.el
index e49afbe38da..0d15d71b6c2 100644
--- a/gptel-rewrite.el
+++ b/gptel-rewrite.el
@@ -743,7 +743,7 @@ generated from functions."
;; Move back so that the cursor is on the overlay when done.
(unless (get-char-property (point) 'gptel-rewrite)
(when (= (point) (region-end)) (run-at-time 0 nil #'backward-char 1)))
- (deactivate-mark))))
+ (setq deactivate-mark t))))
;; Allow this to be called non-interactively for dry runs
(put 'gptel--suffix-rewrite 'interactive-only nil)