Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can't uncomment in sexy mode with NERDCompactSexyComs=1 for lua #451

Merged
merged 1 commit into from
Feb 2, 2021
Merged

fix: can't uncomment in sexy mode with NERDCompactSexyComs=1 for lua #451

merged 1 commit into from
Feb 2, 2021

Conversation

kevinhwang91
Copy link
Contributor

reproduce issue:

  1. open lua file;
  2. run ex let g:NERDCompactSexyComs = 1;
  3. enter visual mode and select multiple lines;
  4. <leader>cs;
  5. <leader>cu;

solve this issue by escaping [ and ].

@alerque
Copy link
Member

alerque commented Dec 18, 2020

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.

@kevinhwang91
Copy link
Contributor Author

kevinhwang91 commented Dec 18, 2020

I think it's not related above issues, this issue is caused by

"the right delimiter is on the same line as the last sexyComMarker
elseif theLine =~# '^[ \t]*' . sexyComMarker . '.*' . right
let bottom = currentLine

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.

@alerque alerque merged commit b83e9cd into preservim:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants