From a6633a88a8b2c580aa1aa38354aa858236dfc17e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 23 May 2021 23:32:24 +0300 Subject: fix: reveal snippets --- editors/code/src/snippets.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'editors') diff --git a/editors/code/src/snippets.ts b/editors/code/src/snippets.ts index 9561aa345..58f7aa128 100644 --- a/editors/code/src/snippets.ts +++ b/editors/code/src/snippets.ts @@ -56,6 +56,9 @@ export async function applySnippetTextEdits(editor: vscode.TextEditor, edits: vs } }); if (selections.length > 0) editor.selections = selections; + if (selections.length === 1) { + editor.revealRange(selections[0], vscode.TextEditorRevealType.InCenterIfOutsideViewport); + } } function parseSnippet(snip: string): [string, [number, number]] | undefined { -- cgit v1.2.3