Closed kevinhwang91 closed 3 years ago
Thanks for taking the time to contribute this. I'd definitely like to see it fixed. Before I merge however I'd like to understand how this will/won't affect other languages and issues. We've had some uncommenting issues reported before that we've never gotten around to fixing and I wonder how related this is. See e.g. #339, #341, #68, #295, #291, #74, #150, and maybe others.
At the very least this is probably a fix for #150, but lets also determine its impact on other issues.
I think it's not related above issues, this issue is caused by https://github.com/preservim/nerdcommenter/blob/119b99d1662113a588734e3666213d246e50900d/plugin/NERD_commenter.vim#L2257-L2259
theLine
value at the lastline looks like [ lastline ]]
.
In lua, '^[ \t]*' . sexyComMarker . '.*' . right
= '^[ \t]*' . '[' . '.*' . ']]'
. Without escaping [
and ]
, ^[ \t]*[.*]]
can't match [ lastline ]]
.
This PR can't solve other issues but in order to fix the match for left
and right
.
reproduce issue:
let g:NERDCompactSexyComs = 1
;<leader>cs
;<leader>cu
;solve this issue by escaping
[
and]
.