Skip to content

Commit

Permalink
gptel: Better handling of read-only bufs
Browse files Browse the repository at this point in the history
* gptel.el (gptel--insert-response): Turn on visual-line-mode in
the response buffer that is created when the gptel buffer is
read-only.

* gptel-curl.el (gptel-curl--stream-insert-response): Ditto.
  • Loading branch information
karthink committed Jan 16, 2024
1 parent 1752f1d commit 3fb064a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions gptel-curl.el
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ See `gptel--url-get-response' for details."
(message "Buffer is read only, displaying reply in buffer \"*ChatGPT response*\"")
(display-buffer
(with-current-buffer (get-buffer-create "*ChatGPT response*")
(visual-line-mode 1)
(goto-char (point-max))
(move-marker (plist-get proc-info :position) (point) (current-buffer))
(current-buffer))
Expand Down
1 change: 1 addition & 0 deletions gptel.el
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ See `gptel--url-get-response' for details."
(message "Buffer is read only, displaying reply in buffer \"*ChatGPT response*\"")
(display-buffer
(with-current-buffer (get-buffer-create "*ChatGPT response*")
(visual-line-mode 1)
(goto-char (point-max))
(move-marker start-marker (point) (current-buffer))
(current-buffer))
Expand Down

0 comments on commit 3fb064a

Please sign in to comment.