liquidz / vim-iced

Clojure Interactive Development Environment for Vim8/Neovim
https://liquidz.github.io/vim-iced/
MIT License
518 stars 35 forks source link

Comment aware eval top #333

Closed pinealan closed 3 years ago

pinealan commented 3 years ago

Modifies the behavior of :IcedEvalOuterTopList and Plug(iced_eval_outer_top_list) when the cursor is inside forms that have a root comment form. Evaluation will be of the topmost form inside the comment, instead of evaluating all forms in the comment as a do.

When the cursor is directly inside the comment form, the current behavior of eval as do is preserved.

As example to illustrate:

(comment
  (print (πŸ“"Hello"))
  (print ("world")))
; => hello

(comment
πŸ“(print ("hello"))
  (print ("world")))
; => helloworld
codecov-commenter commented 3 years ago

Codecov Report

Merging #333 (526121b) into main (0a96584) will decrease coverage by 0.11%. The diff coverage is 60.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
- Coverage   77.41%   77.30%   -0.12%     
==========================================
  Files          74       74              
  Lines        6687     6733      +46     
==========================================
+ Hits         5177     5205      +28     
- Misses       1510     1528      +18     
Impacted Files Coverage Ξ”
autoload/iced/socket_repl.vim 44.37% <0.00%> (ΓΈ)
autoload/iced/paredit.vim 82.38% <60.86%> (-6.74%) :arrow_down:
autoload/iced/nrepl/eval.vim 85.27% <100.00%> (ΓΈ)

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 0a96584...526121b. Read the comment docs.