File tree 2 files changed +15
-4
lines changed
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -1106,10 +1106,7 @@ namespace ts.formatting {
1106
1106
* Trimming will be done for lines after the previous range
1107
1107
*/
1108
1108
function trimTrailingWhitespacesForRemainingRange ( ) {
1109
- if ( ! previousRange ) {
1110
- return ;
1111
- }
1112
- const startPosition = previousRange . end ;
1109
+ const startPosition = previousRange ? previousRange . end : originalRange . pos ;
1113
1110
1114
1111
const startLine = sourceFile . getLineAndCharacterOfPosition ( startPosition ) . line ;
1115
1112
const endLine = sourceFile . getLineAndCharacterOfPosition ( originalRange . end ) . line ;
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+ ////function foo()
3
+ ////{
4
+ //// var bar;
5
+ //// /*1*/
6
+ //// }
7
+ goTo . marker ( '1' )
8
+ edit . insertLine ( "" ) ;
9
+ verify . currentFileContentIs ( `function foo()
10
+ {
11
+ var bar;
12
+
13
+
14
+ }` ) ;
You can’t perform that action at this time.
0 commit comments