Skip to content

Commit

Permalink
Opens task file in text editor if preview fails
Browse files Browse the repository at this point in the history
  • Loading branch information
baflo committed Sep 24, 2024
1 parent 560c583 commit 7eb14bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext-src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ export async function activate (context: vscode.ExtensionContext): Promise<void>
const taskPath = path.join(folderPath, taskFilename)

const taskfileEditor = vscode.workspace.getConfiguration('kanbn').get<boolean>('taskfileEditor')
await vscode.commands.executeCommand('vscode.openWith', vscode.Uri.file(taskPath), taskfileEditor)
try {
await vscode.commands.executeCommand('vscode.openWith', vscode.Uri.file(taskPath), taskfileEditor)
} catch {
const textDoc = await vscode.workspace.openTextDocument(taskPath)
await vscode.window.showTextDocument(textDoc)
}
}
})
)
Expand Down

0 comments on commit 7eb14bf

Please sign in to comment.