From 4ab79511c9190243ea9ed23ad4f087d6f6729ea1 Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Fri, 26 Jan 2024 07:12:47 +0100 Subject: [PATCH] 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. --- kagi.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kagi.el b/kagi.el index 4895ecb..061b578 100644 --- a/kagi.el +++ b/kagi.el @@ -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))