gptel: Fix gptel-end-of-response

* gptel.el (gptel-end-of-response): Handle non-interactive case
where one of the function arguments can be nil.  Fix #262.
This commit is contained in:
Karthik Chikmagalur 2024-03-19 17:39:13 -07:00
parent 5dcbf40066
commit 22f7043c32

View file

@ -557,6 +557,7 @@ Note: This will move the cursor."
"Move point to the end of the LLM response ARG times."
(interactive (list nil nil
(prefix-numeric-value current-prefix-arg)))
(unless arg (setq arg 1))
(let ((search (if (> arg 0)
#'text-property-search-forward
#'text-property-search-backward)))