tomtom / tcomment_vim

An extensible & universal comment vim-plugin that also handles embedded filetypes
http://www.vim.org/scripts/script.php?script_id=1173
GNU General Public License v3.0
1.4k stars 103 forks source link

[FR] TCommentBlockOrInline #302

Open huyz opened 2 years ago

huyz commented 2 years ago

In both JetBrains IDEs and VS Code, if we do a block comment, we get a combination of TCommentBlock or TCommentInline.

If multiple lines are selected, we end up with something similar to TCommentBlock:

/*
line 1
line 2
*/

But if only part of a line is selected, we end up with something similar to TCommentInline:

part /*of the*/ line

The behavior simply depends on the selection.

Could we have something like that in tcomment too? Right now, I use TCommentInline but if I select multiple lines, I end up with something like:

/* line 1 */
/* line 2 */
tomtom commented 2 years ago

It depends on the filetype whether block comments are supported. For supported filetypes, b on selected lines should use block comments.

WRT to your idea to automatically switch between inline vs block comments: I understand your wish from an usability point of view but this logic doesn't fit well into how the plugin works. If I had too much time to spare I'd ponder it but I don't think this will happen anytime soon.

huyz commented 2 years ago

Yeah, this is very low priority