mjmlio / vscode-mjml

MJML preview, lint, compile for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=attilabuti.vscode-mjml
MIT License
178 stars 24 forks source link

Add option to prevent preview switching files #13

Closed Daniel-Knights closed 3 years ago

Daniel-Knights commented 3 years ago

Why

As a user of this extension, it's frustrating to edit a separate MJML file and have the previewer switch automatically.

How

Adding a config option that would allow turning this off. If the option is set to false, it prevents changing views to the separately edited file, but still displays relevant updates which carry across files (i.e. through <mj-include...).

README suggestion

Add this line to the bottom of the config options table:

| `mjml.switchOnSeparateFileChange` | `true` | Automatically switch previews when editing a different file. |
iRyusa commented 3 years ago

Hi @Daniel-Knights can you add a small gif of this feature please ?

Daniel-Knights commented 3 years ago

Hi @iRyusa, sure thing:

EDIT - Gif deleted for legal reasons

kmcb777 commented 3 years ago

Hi @Daniel-Knights , just to let you know that extension v1.0.5 has just been published, including both your PRs Thanks for your work !