branch: elpa/gptel commit a7dde728eb6f6046641287d63e17ae8aef153119 Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com> Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
gptel: Fix bug with navigating responses * gptel.el (gptel-end-of-response): Fix bug where a literal "?" was searched for when the prompt-prefix and response-prefix strings were empty or blank. --- gptel.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gptel.el b/gptel.el index bc3615ac82..eadf9088a6 100644 --- a/gptel.el +++ b/gptel.el @@ -954,15 +954,15 @@ Note: This will move the cursor." (dotimes (_ (abs arg)) (funcall search 'gptel 'response t) (if (> arg 0) - (when (looking-at (concat "\n\\{1,2\\}" - (regexp-quote - (gptel-prompt-prefix-string)) - "?")) + (when-let* ((prefix (gptel-prompt-prefix-string)) + ((not (string-empty-p prefix))) + ((looking-at (concat "\n\\{1,2\\}" + (regexp-quote prefix) "?")))) (goto-char (match-end 0))) - (when (looking-back (concat (regexp-quote - (gptel-response-prefix-string)) - "?") - (point-min)) + (when-let* ((prefix (gptel-response-prefix-string)) + ((not (string-empty-p prefix))) + ((looking-back (concat (regexp-quote prefix) "?") + (point-min)))) (goto-char (match-beginning 0))))))) (defmacro gptel--at-word-end (&rest body)