do not apply format on enter for the first line

This commit is contained in:
Vladimir Matveev
2015-01-13 19:11:21 -08:00
parent 4a1851c7b8
commit 2ce6c5635d

View File

@@ -68,7 +68,9 @@ module ts.formatting {
export function formatOnEnter(position: number, sourceFile: SourceFile, rulesProvider: RulesProvider, options: FormatCodeOptions): TextChange[] {
var line = sourceFile.getLineAndCharacterFromPosition(position).line;
Debug.assert(line >= 2);
if (line === 1) {
return [];
}
// get the span for the previous\current line
var span = {
// get start position for the previous line