Sublime Forum

Auto indent bug with strings containing parens

#1

Consider the following Ruby code:

puts "(barf"

If you hit Enter at the end of this line, ST will indent the next line:

puts "(barf" |

In other words, it interprets the opening parenthesis inside the string as being meaningful to the indentation. The bug only seems to affect opening parantheses.

0 Likes

#2

I was able to work around this bug with:
“smart_indent”: false,

0 Likes

#3

I was able to work this around (and not remove smart indentation) by adding a comment, containing “)”, at the end of the line where the parenthesis opens.

E.g.:

var message = question.concat(" (write "); //)
// hereafter the indentation is still correct

0 Likes