Avoid recalculating the current line.
This commit is contained in:
parent
1bbf109e8e
commit
59fe72ee7d
@ -243,7 +243,9 @@ export default class Printer {
|
||||
// catch up to this nodes newline if we're behind
|
||||
const pos = loc ? loc[prop] : null;
|
||||
if (pos && pos.line !== null) {
|
||||
while (this._buf.getCurrentLine() < pos.line) {
|
||||
const count = pos.line - this._buf.getCurrentLine();
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
this._newline();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user