branch: elpa/gptel
commit aa5f0737f24d2876bccec3edc22337d06c58ca56
Author: daedsidog <[email protected]>
Commit: karthink <[email protected]>

    gptel-context: whitespace at end of context string
    
    * gptel-context.el (gptel-context--string): Remove trailing
    whitespace at the end of the context string.
---
 gptel-context.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gptel-context.el b/gptel-context.el
index 9218cef2ec..7959b06478 100644
--- a/gptel-context.el
+++ b/gptel-context.el
@@ -303,6 +303,9 @@ context overlays, see `gptel-context--alist'."
              do (gptel-context--insert-buffer-string buf ovs)
              else do (gptel-context--insert-file-string buf)
              do (insert "\n\n")
+             finally do
+             (skip-chars-backward "\n\t\r ")
+             (delete-region (point) (point-max))
              finally return (buffer-string))))
 
 ;;; Major mode for context inspection buffers

Reply via email to