mirror of
https://github.com/esm7/obsidian-vimrc-support.git
synced 2026-07-22 05:00:25 +00:00
Add selection argument to jsfile
It was only given to `jscommand`.
This commit is contained in:
parent
637676d3ab
commit
d5b28c550a
1 changed files with 4 additions and 2 deletions
6
main.ts
6
main.ts
|
|
@ -562,9 +562,11 @@ export default class VimrcPlugin extends Plugin {
|
|||
} catch (e) {
|
||||
throw new Error(`Cannot read file ${params.args[0]} from vault root: ${e.message}`);
|
||||
}
|
||||
const command = Function('editor', 'view', content + extraCode);
|
||||
let currentSelections = this.currentSelection;
|
||||
var chosenSelection = currentSelections[0];
|
||||
const command = Function('editor', 'view', 'selection', content + extraCode);
|
||||
const view = this.getActiveView();
|
||||
command(view.editor, view);
|
||||
command(view.editor, view, chosenSelection);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue