Registering a default custom editor, but **not** while in diff mode #799
-
|
I have an extension that provides a custom editor and registers it as the default editor for markdown files. However, when viewing markdown files in diff mode (such as in the Source Control panel), I want to fall back to using the built-in editor. Two questions:
package.json: "customEditors": [
{
"viewType": "my-custom-editor",
"selector": [
{
"filenamePattern": "*.md"
}
],
"priority": "default"
}
],Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi @jonathanyeung. Here are my thoughts...
What you can consider:
Hope this helps. |
Beta Was this translation helpful? Give feedback.
Hi @jonathanyeung.
Here are my thoughts...
Different Editor in Diff Mode:
When you register a custom editor with a
priorityofdefaultfor a specific file type, it will be used in all contexts, including in diff views. From what I know, the VS Code API did not provide an explicit way for a custom editor to specify that it should only be used as the default in certain contexts (like outside of diff views).Open Diff with a Specific Editor:
VS Code has the "Open with..." context menu which lets users choose a specific editor to open a file. However, there isn't a direct "Open diff with..." counterpart. If a user wants to see the diff in the built-in editor after a custom editor has take…