Skip to content

Commit 1df6432

Browse files
authored
Merge pull request #103 from twio142/patch-1
Add `selection` argument to `jsfile`
2 parents 637676d + d5b28c5 commit 1df6432

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,11 @@ export default class VimrcPlugin extends Plugin {
562562
} catch (e) {
563563
throw new Error(`Cannot read file ${params.args[0]} from vault root: ${e.message}`);
564564
}
565-
const command = Function('editor', 'view', content + extraCode);
565+
let currentSelections = this.currentSelection;
566+
var chosenSelection = currentSelections[0];
567+
const command = Function('editor', 'view', 'selection', content + extraCode);
566568
const view = this.getActiveView();
567-
command(view.editor, view);
569+
command(view.editor, view, chosenSelection);
568570
});
569571
}
570572

0 commit comments

Comments
 (0)