branch: elpa/aidermacs
commit 49a5a591d4a6a3377a301e43865b1b85457d1e76
Author: Massimiliano Mirra <b...@hyperstruct.net>
Commit: Massimiliano Mirra <b...@hyperstruct.net>

    fix: don't switch to aider buffer before reading symbol
---
 aidermacs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aidermacs.el b/aidermacs.el
index 8910c7b1c4..a6d256f2a4 100644
--- a/aidermacs.el
+++ b/aidermacs.el
@@ -597,13 +597,13 @@ If point is in a function, explain that function."
 (defun aidermacs-explain-symbol-under-point ()
   "Ask aidermacs to explain symbol under point, given the code line as 
background info."
   (interactive)
-  (aidermacs-add-current-file)
   (let* ((symbol (thing-at-point 'symbol))
          (line (buffer-substring-no-properties
                 (line-beginning-position)
                 (line-end-position)))
          (prompt (format "/ask Please explain what '%s' means in the context 
of this code line: %s"
                          symbol line)))
+    (aidermacs-add-current-file)    
     (aidermacs--send-command prompt t)))
 
 (defun aidermacs-send-command-with-prefix (prefix command)

Reply via email to