Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
fix: error in show preview command
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSiefke committed Apr 12, 2019
1 parent afaafb1 commit e539deb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ export async function activate(c: vscode.ExtensionContext): Promise<void> {
vscode.commands.registerCommand(
'svgPreview.showPreview',
async (uri: vscode.Uri) => {
if (!shouldOpenUri(uri)) {
const actualUri = uri || vscode.window.activeTextEditor.document.uri
if (!shouldOpenUri(actualUri)) {
return
}
previewPanel.show({
viewColumn: vscode.ViewColumn.Active,
fsPath: uri.fsPath,
fsPath: actualUri.fsPath,
})
const textDocument = await vscode.workspace.openTextDocument(uri)
const textDocument = await vscode.workspace.openTextDocument(actualUri)
previewPanel.content = textDocument.getText()
}
)
Expand Down

0 comments on commit e539deb

Please sign in to comment.