mirror of
https://github.com/nyanotech/recombobulator
synced 2025-12-16 03:20:22 -08:00
Handle multiple selections
This commit is contained in:
parent
cc9aa2e199
commit
d3c60af233
@ -8,13 +8,13 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
if (editor) {
|
||||
const document = editor.document;
|
||||
const selection = editor.selection;
|
||||
const text = document.getText(selection);
|
||||
|
||||
const processed = Buffer.from(text).toString('base64'); // TODO - handle different character encodings
|
||||
|
||||
editor.edit(editBuilder => {
|
||||
editBuilder.replace(selection, processed);
|
||||
editor.selections.forEach(selection => {
|
||||
const text = document.getText(selection);
|
||||
const processed = Buffer.from(text).toString('base64'); // TODO - handle different character encodings
|
||||
editBuilder.replace(selection, processed);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user