Skip to content

Commit

Permalink
Add option to include filename in status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelHentschel committed Oct 14, 2023
1 parent 2d0688b commit dc282e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,12 @@
"default": "",
"markdownDescription": "The jobname argument of the compiling tool, which is used by the extension to find project files (e.g., PDF and SyncTeX files). This config should be set identical to the value provided to the `-jobname=` argument, and should not have placeholders. Leave the config empty to ignore jobname and keep the default behavior."
},
"latex-workshop.latex.build.rootfileInStatus": {
"scope": "resource",
"type": "boolean",
"default": false,
"markdownDescription": "Whether to include the name of the root file being built in the status bar."
},
"latex-workshop.latex.texDirs": {
"scope": "window",
"type": "array",
Expand Down
17 changes: 14 additions & 3 deletions src/components/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,24 @@ class BuildToolQueue {
}

getStepString(step: Step): string {
let stepString: string
if (step.timestamp !== this.steps[0]?.timestamp && step.index === 0) {
return step.recipeName
stepString = step.recipeName
} else if (step.timestamp === this.steps[0]?.timestamp) {
return `${step.recipeName}: ${step.index + 1}/${this.steps[this.steps.length - 1].index + 1} (${step.name})`
stepString = `${step.recipeName}: ${step.index + 1}/${this.steps[this.steps.length - 1].index + 1} (${step.name})`
} else {
return `${step.recipeName}: ${step.index + 1}/${step.index + 1} (${step.name})`
stepString = `${step.recipeName}: ${step.index + 1}/${step.index + 1} (${step.name})`
}
if(step.rootFile) {
const rootFileUri = vscode.Uri.file(step.rootFile)
const configuration = vscode.workspace.getConfiguration('latex-workshop', rootFileUri)
const showFilename = configuration.get<boolean>('latex.build.rootfileInStatus', false)
if(showFilename) {
const relPath = vscode.workspace.asRelativePath(step.rootFile)
stepString = `${relPath}: ${stepString}`
}
}
return stepString
}

getStep(): Step | undefined {
Expand Down

0 comments on commit dc282e9

Please sign in to comment.