Closed ulyssesdotcodes closed 5 years ago
Hi @ulyssesp,
Thank you for your contribution!
I can see what improvement you're trying to make but I have two concerns:
(let [s "hello"]
(println s) ;; cursor is here
)
Region evaluation causes an error in this situation, because you define a region as a text between two empty lines, which is not enough in this case.
This leads me to the idea that it would be better to add "Evaluate Form" command rather than "Evaluate Region". I believe it's not hard to make necessary changes to the code you've already provided and find forms by counting opening and closing brackets. This approach is much less fragile than looking for empty lines.
I'm going to close this PR for now, but I will be more than happy to accept the changes with the forms evaluation.
Useful for evaluating single expressions in nREPL.