guns / vim-sexp

Precision Editing for S-expressions
MIT License
612 stars 33 forks source link

Capture and emit should not treat comments as elements #13

Open snoe opened 9 years ago

snoe commented 9 years ago

When capturing tail on a top level form, capture will place the bracket at the end of subsequent comments. Similar behavior can be seen with emit-tail. This seems surprising to me as it unbalances forms. Capture and emit should probably ignore comments altogether and act on the next real element.

Given the following with the cursor on foo.

(foo) ;comment-a
bar
;; comment-b
zap

Capture tail twice should produce

(foo ;comment-a
bar
;; comment-b
zap)
guns commented 9 years ago

I agree; this is actually on a todo list in the autoload script.

I'll take a look tonight as I finish up #10. Thanks!