Skip to content

Commit

Permalink
Ability to set echo=TRUE in run source by default (#1286)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-jedrusiak committed Feb 1, 2023
1 parent dc5be83 commit 77aab53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,11 @@
"default": "UTF-8",
"markdownDescription": "An optional encoding to pass to R when executing the file, i.e. `source(FILE, encoding=ENCODING)`."
},
"r.source.echo": {
"type": "boolean",
"default": false,
"markdownDescription": "Should the file be executed with echo option set to TRUE by default, i.e. `source(FILE, echo=TRUE)`?"
},
"r.source.focus": {
"type": "string",
"default": "editor",
Expand Down
4 changes: 4 additions & 0 deletions src/rTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export async function runSource(echo: boolean): Promise<void> {
return;
}
encodingParam = `encoding = "${encodingParam}"`;
const echoParam = util.config().get<boolean>('source.echo');
rPath = [rPath, encodingParam].join(', ');
if (echoParam) {
echo = true;
}
if (echo) {
rPath = [rPath, 'echo = TRUE'].join(', ');
}
Expand Down

0 comments on commit 77aab53

Please sign in to comment.