Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to include filename in status bar #3966

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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