emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ellama acb2a351dd 09/11: Fix code trimming


From: ELPA Syncer
Subject: [elpa] externals/ellama acb2a351dd 09/11: Fix code trimming
Date: Fri, 22 Dec 2023 15:57:51 -0500 (EST)

branch: externals/ellama
commit acb2a351dd6740bd6de83a6a2200346eaa20a549
Author: Steven Allen <steven@stebalien.com>
Commit: Steven Allen <steven@stebalien.com>

    Fix code trimming
    
    Unfortunately, we need to trim the left side before the right.
    The default `string-trim` behavior is to trim the right before the left,
    which deletes the code.
---
 ellama.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ellama.el b/ellama.el
index 7b6e120318..9589e89ddb 100644
--- a/ellama.el
+++ b/ellama.el
@@ -119,7 +119,8 @@
 
 (defun ellama--code-filter (text)
   "Filter code prefix/suffix from TEXT."
-  (string-trim text ellama--code-prefix ellama--code-suffix))
+  ;; Trim left first as `string-trim' trims from the right and ends up 
deleting all the code.
+  (string-trim-right (string-trim-left text ellama--code-prefix) 
ellama--code-suffix))
 
 (defun ellama-setup-keymap ()
   "Set up the Ellama keymap and bindings."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]