From 43fe238c6d65050087df65a92d97f5f31085c835 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Tue, 3 Oct 2017 21:36:54 -0700 Subject: [PATCH] Add support for multiple selections Resolves issue #9 --- src/commands.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/commands.ts b/src/commands.ts index 8b362a7..8959039 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -141,13 +141,12 @@ export class GuidCommands { // 'edit' no longer valid so start a new edit. textEditor.edit(edit => { - - let current = textEditor.selection; - - if (current.isEmpty) { - edit.insert(current.start, item.text); - } else { - edit.replace(current, item.text); + for (const selection of textEditor.selections) { + if (selection.isEmpty) { + edit.insert(selection.start, item.text); + } else { + edit.replace(selection, item.text); + } } if (item.named) {