Skip to content

Commit a4e5805

Browse files
committed
fix merging snippets
increase nesting level of the snippet based on how many snippets need to be merged instead an arbitrary value of 10.
1 parent 91c7deb commit a4e5805

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/editor/contrib/snippet/browser/snippetSession.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ export class OneSnippet {
289289
merge(others: OneSnippet[]): void {
290290

291291
const model = this._editor.getModel();
292-
this._nestingLevel *= 10;
292+
this._nestingLevel *= Math.max(
293+
...others.map(o => o._snippet.placeholderInfo.last?.index || 8)
294+
) + 2;
293295

294296
this._editor.changeDecorations(accessor => {
295297

0 commit comments

Comments
 (0)