branch: elpa/aidermacs
commit e7ed9570ed2f03da4bf3dafafe51391dc71c8e49
Author: Kang Tu <[email protected]>
Commit: Kang Tu (aider) <[email protected]>
feat: replace new-line characters with spaces in user input for
aider-read-string function
---
aider.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/aider.el b/aider.el
index 94ab272b97..6752c2150c 100644
--- a/aider.el
+++ b/aider.el
@@ -26,7 +26,11 @@
(defun aider-read-string (prompt &optional initial-input)
"Read a string from the user with PROMPT and optional INITIAL-INPUT.
This function can be customized or redefined by the user."
- (read-string prompt initial-input))
+ (let ((input (read-string prompt initial-input)))
+ (if (string-match-p "\n" input)
+ (let ((lines (split-string input "\n" t)))
+ (concat (mapconcat 'identity lines " ") (if (string-suffix-p " "
input) "\n" "")))
+ input)))
;; Transient menu for Aider commands
(transient-define-prefix aider-transient-menu ()