Skip to content

Commit

Permalink
master: Fixes #278 bookmarked query changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mtxr committed Jun 26, 2019
1 parent 214fe2c commit 4de76e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/utils/vscode.ts
Expand Up @@ -26,8 +26,11 @@ export async function getSelectedText(action = 'proceed', fullText = false) {
}
return query;
}
export async function insertText(text: string | SnippetString, forceCreate = false) {
export async function insertText(text: string | SnippetString, forceCreate = false, insertAsText = false) {
const editor = await getOrCreateEditor(forceCreate);
if (typeof text === 'string' && insertAsText) {
return void Promise.all(editor.selections.map(cursor => editor.edit(e => e.insert(cursor.active, text))));
}
await Promise.all(editor.selections.map(cursor => editor.insertSnippet(text instanceof SnippetString ? text : new SnippetString(`\${1:${text}}$0`), cursor.active)));
}

Expand Down

0 comments on commit 4de76e3

Please sign in to comment.