Skip to content

Regex ending in * breaks indenting in block below it #324

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

Closed
eddiezane opened this issue Nov 24, 2015 · 5 comments
Closed

Regex ending in * breaks indenting in block below it #324

eddiezane opened this issue Nov 24, 2015 · 5 comments

Comments

@eddiezane
Copy link

It appears a regex ending in * breaks indenting below it in a block.

if (true) {
  var re = /.*/;
console.log('I am broken');
console.log('Because I end in *');
}

if (true) {
  var re = /.*$/;
  console.log('I do not end in *');
  console.log('So I am fine');
}

Can anyone replicate or confirm?

Apologies if this was already reported.

@davidchambers
Copy link
Collaborator

I can't reproduce the problem. Could you disable your plugins one by one to confirm vim-javascript is responsible?

@eddiezane
Copy link
Author

Reproduced it with a completely blank vimrc aside from vim-javascript.

Try running a gg=G on it in a buffer?

@davidchambers
Copy link
Collaborator

Try running a gg=G on it in a buffer?

Ah, now I see it! Thanks for taking the time to verify that vim-javascript is at fault.

The problem is that none of this project's current maintainers is familiar with the indentation-related code.

@amadeus
Copy link
Collaborator

amadeus commented Apr 20, 2016

@bounceme it appears some of the fixes we have in place, do not function when gg=G is used. Everything works fine when you type out the examples manually however. Any ideas?

bounceme added a commit to bounceme/vim-javascript that referenced this issue Apr 21, 2016
This should work
@amadeus
Copy link
Collaborator

amadeus commented Apr 22, 2016

This issue should be fixed in develop, by #390

@amadeus amadeus closed this as completed Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants