Browse Source

Fix #264

* indium-interaction.el (indium-interaction--eval-node): Make sure to insert the
result of the evaluation in the source buffer.
master
Nicolas Petton 7 months ago
parent
commit
8499e156bf
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      indium-interaction.el

+ 9
- 7
indium-interaction.el View File

@ -164,13 +164,15 @@ If there is no debugging session, signal an error."
(defun indium-interaction--eval-node (node &optional print)
"Evaluate the AST node NODE.
If PRINT is non-nil, print the output into the current buffer."
(js2-mode-wait-for-parse
(lambda ()
(indium-eval (js2-node-string node)
(lambda (value)
(indium-interaction--handle-eval-result
value
print))))))
(let ((buf (current-buffer)))
(js2-mode-wait-for-parse
(lambda ()
(indium-eval (js2-node-string node)
(lambda (value)
(with-current-buffer buf
(indium-interaction--handle-eval-result
value
print))))))))
(defun indium-interaction--handle-eval-result (value &optional print)
"Handle VALUE is the result of an evaluation.


Loading…
Cancel
Save