Comment.nvim icon indicating copy to clipboard operation
Comment.nvim copied to clipboard

Include padding for linewise comments on empty lines

Open brdoney opened this issue 1 year ago • 0 comments

I noticed that toggling a linewise comment (e.g. require("Comment.api").toggle.linewise.current()) on an empty line does not add padding. Interestingly, when a line is just whitespace, it does add padding.

So is leaving padding out of empty lines intentional? Personally, I think padding should be added universally.

I have been writing a function to toggle comments while in insert mode and the lack of whitespace unfortunately causes an issue while on empty lines. Specifically, if I want to start a comment on an empty line, I have to toggle the comment then manually add padding before I start writing my comment, since the plugin doesn't add it (which is obviously not desirable).

brdoney avatar Nov 19 '24 21:11 brdoney