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

How to make uncomment remove only 1 space? #303

Closed huyz closed 1 year ago

huyz commented 2 years ago

I have:

let g:tcomment#options = {
            \ 'col': 1,
            \ 'whitespace': 'no',
            \ 'strip_whitespace': '0'
            \ }

This works for adding no whitespace. But then when I reverse the commenting operation, a space gets eaten. How do I stop whitespace from being eaten?

tomtom commented 1 year ago

Which filetype is this about? It seems to me this is a problem with filetypes whose comment definition uses commentstring_rx since the whitespace option deals only with commentstring.

huyz commented 1 year ago

Oh this was for javascript and not languages like vimscript/python/shell. But you obviously figured that out and I can confirm your commit fixed it.

Thanks!