Skip to content

Commit 41eaf2d

Browse files
committed
gptel-context: Fix overlay handling in gptel-context-remove-all
* gptel-context.el (gptel-context-remove-all): After the `gptel-context' spec change, buffer regions in the context are specified in a plist with the :overlays key and not a list of overlays. Update `gptel-context-remove-all' to handle this. (#1142)
1 parent a8524fd commit 41eaf2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gptel-context.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ afterwards."
335335
(when (or (not verbose) (y-or-n-p "Remove all context? "))
336336
(cl-loop
337337
for context in gptel-context
338-
for (source . ovs) = (ensure-list context)
339-
if (cl-every #'overlayp ovs) do ;Buffers and buffer regions
340-
(mapc #'gptel-context-remove ovs)
338+
for (source . spec) = (ensure-list context)
339+
if (bufferp source) do ;Buffers and buffer regions
340+
(mapc #'gptel-context-remove (plist-get spec :overlays))
341341
else do (gptel-context-remove source) ;files or other types
342342
finally do (setq gptel-context nil)))
343343
(when verbose (message "Removed all gptel context sources."))))

0 commit comments

Comments
 (0)