Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* indium-interaction.el (indium-interaction--eval-node): Make sure to insert the
result of the evaluation in the source buffer.
  • Loading branch information
NicolasPetton committed Mar 9, 2021
1 parent 8432296 commit 8499e15
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions indium-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8499e15

Please sign in to comment.