diff --git a/spec/wasm-tree-sitter-language-mode-spec.js b/spec/wasm-tree-sitter-language-mode-spec.js index 447c579ac..8b7daf33a 100644 --- a/spec/wasm-tree-sitter-language-mode-spec.js +++ b/spec/wasm-tree-sitter-language-mode-spec.js @@ -3919,16 +3919,17 @@ describe('WASMTreeSitterLanguageMode', () => { // made. But in async indent mode, we cannot make any indentation // suggestions until the end of the transaction. // - // Still, in some scenarios, this will be OK. We can make each of these - // indentation decisions in order once the transaction is done. In this - // case, since each edit + // Still, in some scenarios, this will be OK. Either we can make each + // of these indentation decisions in order once the transaction is + // done, or we can give up and auto-indent the whole range covered by + // the transaction when we're done. // // This is an imperfect heuristic and won't produce good results in // many cases, which is why we flip to async indent reluctantly and - // only in certain scenarios. But it's better than committing to - // N re-parses (where N equals the number of indentation suggestions - // we're asked to make during a given transaction) no matter how high - // N may be. And it's also better than performing no indentation at all + // only in certain scenarios. But it's better than committing to N + // re-parses (where N equals the number of indentation suggestions + // we're asked to make during a given transaction) no matter how high N + // may be. And it's also better than performing no indentation at all // in these cases. editor.insertNewline(); editor.insertText('// this is a comment', { autoIndent: true, autoDecreaseIndent: true }); diff --git a/src/wasm-tree-sitter-language-mode.js b/src/wasm-tree-sitter-language-mode.js index def8daad7..14d600ec9 100644 --- a/src/wasm-tree-sitter-language-mode.js +++ b/src/wasm-tree-sitter-language-mode.js @@ -161,7 +161,7 @@ class WASMTreeSitterLanguageMode { this.useAsyncParsing = FEATURE_ASYNC_PARSE; this.useAsyncIndent = FEATURE_ASYNC_INDENT; this.transactionReparseBudgetMs = REPARSE_BUDGET_PER_TRANSACTION_MILLIS; - this.currentTransactionReparseBudgetMs = this.transactionReparseBudgetMs; + this.currentTransactionReparseBudgetMs = undefined; this.injectionsMarkerLayer = buffer.addMarkerLayer();