src/Tools/VSCode/extension/src/preview.ts
changeset 66027 396785562768
parent 65994 46123b9dadc8
child 66064 5a00cec6bc82
equal deleted inserted replaced
66025:96f86c613a9f 66027:396785562768
    78     {
    78     {
    79       const preview_uri = encode_preview(Uri.parse(params.uri))
    79       const preview_uri = encode_preview(Uri.parse(params.uri))
    80       if (preview_uri) {
    80       if (preview_uri) {
    81         preview_content.set(preview_uri.toString(), params.content)
    81         preview_content.set(preview_uri.toString(), params.content)
    82         content_provider.update(preview_uri)
    82         content_provider.update(preview_uri)
    83         if (params.column != 0) {
    83 
       
    84         const existing_document =
       
    85           workspace.textDocuments.find(document =>
       
    86             document.uri.scheme === preview_uri.scheme &&
       
    87             document.uri.query === preview_uri.query)
       
    88         if (!existing_document && params.column != 0) {
    84           commands.executeCommand("vscode.previewHtml", preview_uri, params.column, params.label)
    89           commands.executeCommand("vscode.previewHtml", preview_uri, params.column, params.label)
    85         }
    90         }
    86       }
    91       }
    87     })
    92     })
    88 }
    93 }