Mermaid-Chart / vscode-mermaid-preview

Previews Mermaid diagrams
MIT License
142 stars 15 forks source link

[Feature Request] Open diagram via button #110

Open lonix1 opened 3 years ago

lonix1 commented 3 years ago

It would be nice to have a button to open the preview (instead of doing that manually from the command palette).

Exactly like in this extension. It has an "eye" icon on the top right which opens the preview to the right (like we have when opening .md previews).

Thanks for this great extension!

vstirbu commented 3 years ago

Thanks for the suggestion!

This makes sense for stand alone .mmd files, but a markdown file can contain multiple diagrams. What should be the behaviour? Preview the diagram where the cursor is, if inside a fence?

lonix1 commented 3 years ago

Didn't think of that, good point!

I'm unsure. At first thought I'd say it should only be for .mmd files, but that may lead to poor usability (user expects that preview button even when it's not showing).

Showing a preview when the cursor is inside a fence is a good option, but wouldn't that lead to higher CPU usage? Because the extension would need to track the cursor. Then again lots of extensions do that already... Tough call.

Options so far:

The simplest option is to not implement this feature! :smile: