gptel-transient: Fix bug when sending in existing session
* gptel-transient.el (gptel--suffix-send, gptel-menu): When reading input from the minibuffer and sending the output to an existing gptel session, only use the prompt read from the minibuffer. Reword the "Overwrite/Delete prompt" option.
This commit is contained in:
parent
00abbf7597
commit
f218388d4d
1 changed files with 14 additions and 13 deletions
|
@ -69,7 +69,7 @@ Or is it the other way around?"
|
||||||
(gptel--infix-model)]
|
(gptel--infix-model)]
|
||||||
["Prompt:"
|
["Prompt:"
|
||||||
("-r" "From minibuffer instead" "-r")
|
("-r" "From minibuffer instead" "-r")
|
||||||
("-i" "Overwrite/Delete prompt" "-i")
|
("-i" "Replace/Delete prompt" "-i")
|
||||||
"Response to:"
|
"Response to:"
|
||||||
("-m" "Minibuffer instead" "-m")
|
("-m" "Minibuffer instead" "-m")
|
||||||
("-n" "New session" "-n"
|
("-n" "New session" "-n"
|
||||||
|
@ -339,6 +339,7 @@ will get progressively longer!"
|
||||||
(setq buffer (get-buffer buffer-name))
|
(setq buffer (get-buffer buffer-name))
|
||||||
(setq output-to-other-buffer-p t)
|
(setq output-to-other-buffer-p t)
|
||||||
(let ((reduced-prompt
|
(let ((reduced-prompt
|
||||||
|
(or prompt
|
||||||
(if (use-region-p)
|
(if (use-region-p)
|
||||||
(buffer-substring-no-properties (region-beginning)
|
(buffer-substring-no-properties (region-beginning)
|
||||||
(region-end))
|
(region-end))
|
||||||
|
@ -350,7 +351,7 @@ will get progressively longer!"
|
||||||
'gptel)
|
'gptel)
|
||||||
t))
|
t))
|
||||||
(point))
|
(point))
|
||||||
(point)))))
|
(point))))))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(insert reduced-prompt)
|
(insert reduced-prompt)
|
||||||
|
|
Loading…
Add table
Reference in a new issue