Open nano-o opened 2 years ago
What happens — is this something about backslash escaping that isn't working right?
The uncommenting command just doesn't do anything.
To reproduce, set g:NERDCustomDelimiters = { 'tla': { 'left': '\\*', 'leftAlt': '(*', 'rightAlt': '*)' } }
Then create a file myfile.tla
with contents:
\* this is a comment
Set filetype to tla
.
Now try the uncommenting command. It does not work.
let g:NERDCustomDelimiters = { 'tla': { 'left': '\\*', 'leftAlt': '(*', 'rightAlt': '*)' } }
Using this (which as of your PR #497 is merged so you don't need to add it to your configs, just update your plugins) produces a commented line prefixed with \\*
not \*
as in your example file. Of course it won't reverse. It works for me to uncomment the lines it comments. Did you use the wrong comment string or mistake when escaping backslashes are needed?
Okay that's strange. I removed the line above from my config and update the plugin. The commenting command <Leader>c<space>
produces \*
and not \\*
. But you're right that if I start a line with \\*
then uncommenting works. I'm using neovim btw; is that the problem?
Well, I get the same behavior in vim. If I start with
this is a comment
and hit <Leader>c<space>
, I get
\* this is a comment
Hitting <Leader>c<space>
again I get
\* \* this is a comment
If I start with
\\* this is a comment
and hit <Leader>c<space>
, I get
this is a comment
I'm in Neovim too. <Leader>c<Space>
only toggles \\*
prefixes for me, using the current state of this plugin with no modifications.
Okay, maybe it's something platform specific. I just tried in a fresh Ubuntu jammy docker image with a fresh vim install where the only thing I did is install nerdcommenter with vimplug. I get the behavior I described above.
Uncommenting lines starting with
\*
does not work intla
files with the following configuration: