There is method workspace.openTextDocument, but how could I trigger VS Code's built-in image preview functionality ?
You can try to disable some extensions and see if the old preview style back.
For me, this go back after I disable office viewer extension, which change the preview style.
Related
Is there a way to disable the preview mode for my custom text editor without changing the user settings (workbench.editor.enablePreview: false)?
Like it can be done with vscode.window.showTextDocument() and vscode.workspace.TextDocumentShowOptions were you can set preview: false.
I didn't see anything helpful in the extension api. So here is a possible workaround. I assume you can listen for when your custom editor is being opened - and then run this code:
await vscode.commands.executeCommand('workbench.action.keepEditor');
after it is opened. That should take it out of preview mode. It may be the best you can do.
I want to apply a translation extension on VSCode and in the main area it works well, but when I open a markdown preview, it doesn't work on it.
Especially, I want it to work with a pdf view extension. How can I achieve my goals?
Is it possible to stop vscode preview from scrolling, while editing in another tab?
I have a preview open in a splitview, and when I scroll in the document the preview is also scrolling.
Yes you can for markdown. With other languages it would be dependent upon the extension support for that given language.
Markdown you can modify the following settings to make each interdependent of each other:
JSON of each would be:
"markdown.preview.scrollEditorWithPreview": true/false
"markdown.preview.scrollPreviewWithEditor": true/false
I wish to develop an open-source WYSIWYG editor for markdown in vscode.
See the image below. I want an extension that can do something like that.
Change font-sizes for lines for titles.
Change lines indentation for subtitles.
I'm looking at the extension reference: https://code.visualstudio.com/api/references/vscode-api and don't see something that can help.
Do you have an idea how to change the CSS of the editor based on rules? in addition, If you have a link to extension that did it may help.
In other words: How a vscode extension can change css style of the editor window?
You can't change arbitrary css in the editor. See the extension guide for info about the VS Code extension philosophy and how you can extend VS Code
Two options:
Use the decorations api to change rendering of tokens in the editor.
Use a webview to implement a custom view (but don't try re-implementing a text-editor because it will be a pain and will not work like VS Code's normal editors do)
By default, the markdown preview in VS Code opens on the Side. I do this action quite a bit and I always have to drag a drop it to the bottom of the current tab.
I looked in my settings to see if there was a way to change this default behavior and didn't see anything that looks like it would change it.
Any suggestions on how to change this default setting?
You can try to use one of the extensions that allow to execute multiple commands and do:
markdown.showPreviewToSide
workbench.action.toggleEditorGroupLayout