diff options
Diffstat (limited to 'editors/code/src/snippets.ts')
-rw-r--r-- | editors/code/src/snippets.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editors/code/src/snippets.ts b/editors/code/src/snippets.ts index 9561aa345..a409e5296 100644 --- a/editors/code/src/snippets.ts +++ b/editors/code/src/snippets.ts | |||
@@ -52,10 +52,13 @@ export async function applySnippetTextEdits(editor: vscode.TextEditor, edits: vs | |||
52 | } else { | 52 | } else { |
53 | builder.replace(indel.range, indel.newText); | 53 | builder.replace(indel.range, indel.newText); |
54 | } | 54 | } |
55 | lineDelta = countLines(indel.newText) - (indel.range.end.line - indel.range.start.line); | 55 | lineDelta += countLines(indel.newText) - (indel.range.end.line - indel.range.start.line); |
56 | } | 56 | } |
57 | }); | 57 | }); |
58 | if (selections.length > 0) editor.selections = selections; | 58 | if (selections.length > 0) editor.selections = selections; |
59 | if (selections.length === 1) { | ||
60 | editor.revealRange(selections[0], vscode.TextEditorRevealType.InCenterIfOutsideViewport); | ||
61 | } | ||
59 | } | 62 | } |
60 | 63 | ||
61 | function parseSnippet(snip: string): [string, [number, number]] | undefined { | 64 | function parseSnippet(snip: string): [string, [number, number]] | undefined { |