Skip to content

Commit 217e896

Browse files
committed
gptel: Set gptel property as rear-nonsticky globally
* gptel.el: Set the gptel text property as rear-nonsticky globally, by editing the default value of `text-property-default-nonsticky'. This variable is buffer-local, and so gptel never did what we claimed it did, until now: text typed at the end of a response region is not folded into the response. A source of bugs for many years!
1 parent d085040 commit 217e896

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gptel.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,8 @@ file."
654654
;;; Minor mode and UI
655655

656656
;; NOTE: It's not clear that this is the best strategy:
657-
(add-to-list 'text-property-default-nonsticky '(gptel . t))
657+
(cl-pushnew '(gptel . t) (default-value 'text-property-default-nonsticky)
658+
:test #'equal)
658659

659660
(defun gptel--inherit-stickiness (beg end _pre)
660661
"Mark any change to an LLM response region as a response.

0 commit comments

Comments
 (0)