1
0
Fork 0

Do not attempt to insert in read-only buffers

This commit is contained in:
Bram Schoenmakers 2024-01-21 11:09:25 +01:00
parent 0321b635c0
commit a0dd0346a2
Signed by: bram
GPG key ID: 0CCD19DFDC63258F

View file

@ -394,7 +394,7 @@ If INSERT is non-nil, the response is inserted at point.
Otherwise, show the result in a separate buffer."
(interactive "sfastgpt> \nP")
(let ((result (kagi-fastgpt prompt)))
(if insert
(if (and insert (not buffer-read-only))
(save-excursion
(insert result))
(kagi--fastgpt-display-result result))))