File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -3109,13 +3109,12 @@ module ts {
3109
3109
//
3110
3110
// So we only indent if the right side of the binary expression starts further in on the line
3111
3111
// versus the left.
3112
- var operatorEnd = getLineAndCharacterOfPosition ( currentSourceFile , node . operatorToken . end ) ;
3113
- var rightStart = getLineAndCharacterOfPosition ( currentSourceFile , skipTrivia ( currentSourceFile . text , node . right . pos ) ) ;
3114
3112
3115
3113
// Check if the right expression is on a different line versus the operator itself. If so,
3116
3114
// we'll emit newline.
3117
- var onDifferentLine = operatorEnd . line !== rightStart . line ;
3118
- if ( onDifferentLine ) {
3115
+ if ( ! nodeEndIsOnSameLineAsNodeStart ( node . operatorToken , node . right ) ) {
3116
+ var rightStart = getLineAndCharacterOfPosition ( currentSourceFile , skipTrivia ( currentSourceFile . text , node . right . pos ) ) ;
3117
+
3119
3118
// Also, if the right expression starts further in on the line than the left, then we'll indent.
3120
3119
var exprStart = getLineAndCharacterOfPosition ( currentSourceFile , skipTrivia ( currentSourceFile . text , node . pos ) ) ;
3121
3120
var firstCharOfExpr = getFirstNonWhitespaceCharacterIndexOnLine ( exprStart . line ) ;
You can’t perform that action at this time.
0 commit comments