You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! Overall I love the plugin, but I've encountered a bug a few times that I wanted to file:
When certain RegExp literals (from what I can tell, anything ending in .$, '*$', '+$', and any other non-alphanumeric character I've tried followed by $) are passed directly into functions, the following line(s) are auto-indented. You can set them back, but triggering auto-indent in anyway puts it back where it was. It seems like yajs isn't recognizing the close paren at the end of the function invocation, because it also skips the ) when using % to jump between start and end.
I've run into this a few times, but in this case I boiled down the most recent regex to cause it to anything ending in .$.
Test Case
functionfoo(){}foo(/whatever.$/);// hitting % on the open paren will jump to the next close paren it sees in file// this line will auto-indent
Assigning the RegExp to a variable first and passing that in won't cause the indent
functionfoo(){}constreg=/whatever.$/;// no indent herefoo(reg)
Thanks!
The text was updated successfully, but these errors were encountered:
jaawerth
changed the title
broken indenting when some RegExp passed as fn arg
broken indenting/bracket jump when some RegExp passed as fn arg
Aug 19, 2017
Hi there! Overall I love the plugin, but I've encountered a bug a few times that I wanted to file:
When certain RegExp literals (from what I can tell, anything ending in
.$
, '*$', '+$', and any other non-alphanumeric character I've tried followed by $) are passed directly into functions, the following line(s) are auto-indented. You can set them back, but triggering auto-indent in anyway puts it back where it was. It seems like yajs isn't recognizing the close paren at the end of the function invocation, because it also skips the)
when using%
to jump between start and end.I've run into this a few times, but in this case I boiled down the most recent regex to cause it to anything ending in
.$
.Test Case
Assigning the RegExp to a variable first and passing that in won't cause the indent
Thanks!
The text was updated successfully, but these errors were encountered: