Skip to content

Commit

Permalink
Add support for multiple selections
Browse files Browse the repository at this point in the history
Resolves issue #9
  • Loading branch information
heaths committed Oct 4, 2017
1 parent dc6723b commit 43fe238
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 43fe238

Please sign in to comment.