Skip to content

Commit 58fdd01

Browse files
committed
avoid eating all preceding empty lines
1 parent 3433a78 commit 58fdd01

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/services/formatting/formatting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace ts.formatting {
8484
// if the character at the end of the span is a line break, we shouldn't include it, because it indicates we don't want to
8585
// touch the current line at all. Also, on some OSes the line break consists of two characters (\r\n), we should test if the
8686
// previous character before the end of format span is line break character as well.
87-
while (isLineBreak(sourceFile.text.charCodeAt(endOfFormatSpan))) {
87+
if (isLineBreak(sourceFile.text.charCodeAt(endOfFormatSpan))) {
8888
endOfFormatSpan--;
8989
}
9090
const span = {

0 commit comments

Comments
 (0)