Skip to content

Commit

Permalink
release 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
renkun-ken committed Oct 7, 2021
1 parent 827de04 commit 4234546
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/rmarkdown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ async function goToChunk(chunk: RMarkdownChunk) {
// Move cursor 1 line below 'chunk start line'
const line = chunk.startLine + 1;
vscode.window.activeTextEditor.selection = new vscode.Selection(line, 0, line, 0);
await vscode.commands.executeCommand('revealLine', { lineNumber: line, at: 'center'});
await vscode.commands.executeCommand('revealLine', { lineNumber: line, at: 'center' });
}

export function goToPreviousChunk(chunks: RMarkdownChunk[] = _getChunks(),
Expand Down
6 changes: 3 additions & 3 deletions src/rmarkdown/knit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class RMarkdownKnitManager extends RMarkdownManager {
if (yamlParams?.['knit']) {
const knitParam = yamlParams['knit'];
knitCommand = outputFormat ?
`${knitParam}(${docPath}, output_format = '${outputFormat}')`:
`${knitParam}(${docPath}, output_format = '${outputFormat}')` :
`${knitParam}(${docPath})`;
} else if (!this.isREADME(docPath) && yamlParams?.['site']) {
knitCommand = outputFormat ?
Expand All @@ -127,7 +127,7 @@ export class RMarkdownKnitManager extends RMarkdownManager {
// check if the workspace of the document is a R Markdown site.
// the definition of what constitutes an R Markdown site differs
// depending on the type of R Markdown site (i.e., "simple" vs. blogdown sites)
private async findSiteParam(): Promise<string|undefined> {
private async findSiteParam(): Promise<string | undefined> {
const rootFolder = vscode.workspace.workspaceFolders[0].uri.fsPath;
const wad = vscode.window.activeTextEditor.document.uri.fsPath;
const indexFile = (await vscode.workspace.findFiles(new vscode.RelativePattern(rootFolder, 'index.{Rmd,rmd, md}'), null, 1))?.[0];
Expand All @@ -136,7 +136,7 @@ export class RMarkdownKnitManager extends RMarkdownManager {
// 'Simple' R Markdown websites require all docs to be in the root folder
if (fs.existsSync(siteRoot)) {
return 'rmarkdown::render_site';
// Other generators may allow for docs in subdirs
// Other generators may allow for docs in subdirs
} else if (indexFile) {
const indexData = this.getYamlFrontmatter(indexFile.fsPath);
if (indexData?.['site']) {
Expand Down
2 changes: 1 addition & 1 deletion src/rmarkdown/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export class RMarkdownPreviewManager extends RMarkdownManager {
const re = new RegExp(`.*${lim}(.*)${lim}.*`, 'ms');
const outputFile = path.join(tmpDir(), crypto.createHash('sha256').update(filePath).digest('hex') + '.html');
const scriptValues = {
'VSCR_KNIT_DIR' : knitWorkingDirText,
'VSCR_KNIT_DIR': knitWorkingDirText,
'VSCR_LIM': lim,
'VSCR_FILE_PATH': filePath.replace(/\\/g, '/'),
'VSCR_OUTPUT_FILE': outputFile.replace(/\\/g, '/'),
Expand Down

0 comments on commit 4234546

Please sign in to comment.