Merge pull request #103 from twio142/patch-1

Add `selection` argument to `jsfile`
This commit is contained in:
esm7 2022-06-02 06:21:58 +03:00 committed by GitHub
commit 1df6432804
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
});
}