1
0
Fork 0

Trim the translation result

Make sure the result is shown in the echo area when the translation
is a single line followed by a number of trailing newlines.
This commit is contained in:
Bram Schoenmakers 2024-01-26 07:12:47 +01:00
parent 2240dd4a47
commit 4ab79511c9
Signed by: bram
GPG key ID: 0CCD19DFDC63258F

View file

@ -451,7 +451,7 @@ result is short, otherwise it is displayed in a new buffer."
"")
target-language
text))
(result (kagi-fastgpt prompt))
(result (string-trim (kagi-fastgpt prompt)))
(result-lines (length (string-lines result))))
(cond ((and interactive-p (eql result-lines 1)) (message result))
((and interactive-p (> result-lines 1)) (kagi--fastgpt-display-result result))