branch: elpa/aidermacs
commit cef5d7d59bf371185edd41b5d1b5439781490191
Author: Kang Tu <[email protected]>
Commit: Kang Tu (aider) <[email protected]>
feat: add aider-send-paragraph function and key binding in aider-mode
---
aider.el | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/aider.el b/aider.el
index 76aaa7a993..416806cf86 100644
--- a/aider.el
+++ b/aider.el
@@ -256,6 +256,19 @@ The command will be formatted as \"/architect \" followed
by the user command an
(let ((line (thing-at-point 'line t)))
(aider--send-command (concat "/ask " (string-trim line)))))
+;;; New function to send the current paragraph to the Aider buffer
+(defun aider-send-paragraph ()
+ "Send the current paragraph to the Aider buffer."
+ (interactive)
+ (let ((paragraph (buffer-substring-no-properties
+ (save-excursion
+ (backward-paragraph)
+ (point))
+ (save-excursion
+ (forward-paragraph)
+ (point)))))
+ (aider--send-command (string-trim paragraph))))
+
;;; functions for .aider file
;; New function to send "<line under cursor>" to the Aider buffer
@@ -268,8 +281,8 @@ The command will be formatted as \"/architect \" followed
by the user command an
(defun aider-mode-setup ()
"Setup key bindings for Aider mode."
(local-set-key (kbd "C-c C-n") 'aider-send-line-under-cursor)
- (local-set-key (kbd "C-c C-z") 'aider-switch-to-buffer)
- )
+ (local-set-key (kbd "C-c C-b") 'aider-send-block)
+ (local-set-key (kbd "C-c C-p") 'aider-send-paragraph)) ;; Add this line
(add-hook 'aider-mode-hook 'aider-mode-setup)