vim-matchup icon indicating copy to clipboard operation
vim-matchup copied to clipboard

Matching beginning and end of inline comments in JavaScript

Open Aster89 opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. I see that the opening /* and closing */ of a JavaScript comment are not matched.

Describe the solution you'd like The delimiters of inline C++ comments are matched, so I guess allowing the same in JavaScript is desirable (and easy-ish to implement?)

Describe alternatives you've considered Tbh, not jumping between beginning and end of a comment is not a urgent feature. Maybe a nice-to-have.

Additional context Not needed.

Aster89 avatar Oct 31 '21 08:10 Aster89

Technically the same holds for CSS files, which also have the same identical syntax for comments.

Aster89 avatar Oct 31 '21 08:10 Aster89

@andymass , what about the CSS file? Should I open another issue?

Aster89 avatar Dec 24 '21 07:12 Aster89

I have not decided yet if it is necessary to add this. Since all a user would need to do to get this (for any file type) would be to create a file in their configuration e.g., after/ftplugin/css.vim:

call matchup#util#append_match_words('/\*:\*/')

On the other hand, if we add this by default to the plugin, is there any risk of adversely affecting anyone's configuration?

andymass avatar Dec 31 '21 16:12 andymass

If it is so easy (obviously it works, thanks :smile:), then instead of adding this by default, why not writing this solution (a slight rewording of your latest comment) in the doc, e.g. under the FAQ Why does jumping not work for construct X in language Y??

Aster89 avatar Jan 01 '22 06:01 Aster89

Thanks, yeah, that is a good point. I took for granted that match_words and helper functions were documented somewhere but as you mention that is not really true. I will plan to add some FAQ/wiki mentions.

andymass avatar Jan 08 '22 16:01 andymass