preservim / nerdcommenter

Vim plugin for intensely nerdy commenting powers
Creative Commons Zero v1.0 Universal
4.97k stars 447 forks source link

Uncommenting indented code is broken for vim9script #493

Open noscript opened 2 years ago

noscript commented 2 years ago

Commenting Vim9 code works, but uncommenting it does nothing. Only happens for indented code.

https://user-images.githubusercontent.com/717109/176473289-1353d1f2-2b55-4105-a358-ec705a1e01df.mp4

alerque commented 2 years ago

What is the declared ft for vim9script?

Does it allow mixing and mating of old style vimL comments in the same file?

noscript commented 2 years ago

What is the declared ft for vim9script?

vim

Does it allow mixing and mating of old style vimL comments in the same file?

If the first line is vim9script then only new style is allowed.

alerque commented 2 years ago

Are you kidding me? VIM is using the same filetype for it's old vimscript and new vim9script languages that are completely different languages with incompatible SYNTAX?

alerque commented 2 years ago

Is there some other vim setting that gets set reliably that we could use to trigger different rules? How do VIM syntax highlighters handle this?

noscript commented 2 years ago

They can be distinguished by commentstring. New style is #%s, old one is "%s.