Comments (18)
To my knowledge, no new APIs 😔
I would suggest posting this "auto-closing" feature request to vscode (rather than API) because the Markdown preview feature is actually implemented by vscode. We have little control over it as an extension.
from vscode-markdown.
I tried and as expected it is very unstable and annoying. You won't like it.
from vscode-markdown.
That's what I have planned some time ago. 😄
In the long term, the preview behavior might change in future vscode version (e.g. the preview tab might be merged into the Markdown code tab).
And for now, I'll have a try and see if there is a temporary workaround.
from vscode-markdown.
Thank you @neilsustc
e.g. the preview tab might be merged into the Markdown code tab
Great news, I like that feature.
from vscode-markdown.
You can find more details about that feature in #22068.
side-by-side preview inside one tab
But I think it will probably take a long time to finish. 😂
I've published v0.5.1 with a temporary solution.
If you switch to a non-Markdown file, it will close all editors in other editor groups (usually the preview tab is in group 2). So it will be OK if you always edit your files in group 1.
Hope you will like.
from vscode-markdown.
@neilsustc v0.5.1 is not strong. Sometime it kept preview editor and closed other editors. I think it should rollback to v0.5.0.
Then let's wait for improvement of markdown extention.
from vscode-markdown.
Could you provide any reproduction steps?
If it's hard to solve, I will roll back to previous version as you suggested.
from vscode-markdown.
@neilsustc OK, the steps are simple.
- use vscode to open a folder as project
- open a .md file (enough big size such as 20KB), the preview editor is opened and rendering.
- open a non-md file such as
package.json
- package.json editor and the md file editor are closed, and the preview pane is still kept.
from vscode-markdown.
I'll rollback to v0.5.0 as there is another user that also found this bug.
from vscode-markdown.
Hello,
As I understand this feature is not yet developed...
Is there a workaround to get the preview closed when focus is lost?
I mean, when the preview is opened it has the same name (ex: Preview file.md
), maybe searching for opened tab using that name could help..
BTW, thanks great plugin !
from vscode-markdown.
To my knowledge, we can't. Because vscode doesn't provide API to close a editor by name/id.
from vscode-markdown.
I can only find vscode commands like closeActiveEditor
etc. So I cannot find a workaround for now...
from vscode-markdown.
Thanks for the reply...
I think that vscode can bring focus to a newly opened tab (the behavior when a markdown preview is shown), so can it be possible to bring momentarily focus to that tab based on the history of activated tab (or if not possible to track, with some caveat eg. limiting to one opened markdown preview) to close it immediately afterwards (maybe with a callback)?
from vscode-markdown.
I get your point now 😂. Yes, it's possible, but really dangerous 🤣.
from vscode-markdown.
This would be an awesome feature. Any chance the API changed since your last tentative? Maybe opening a feature request in https://github.com/microsoft/vscode otherwise?
from vscode-markdown.
I would suggest posting this "auto-closing" feature request to vscode (rather than API) because the Markdown preview feature is actually implemented by vscode.
Well they still haven't implemented auto-hide of the terminal after all those years and lots of votes, not a good sign 😅
microsoft/vscode#10952
from vscode-markdown.
Also if I drag an .md file into VSCode with other files already open it does enable the preview on the right but then immediately switches the editor back to the previous one. Has anyone else experienced this?
from vscode-markdown.
from vscode-markdown.
Related Issues (20)
- Support add a space between Latin and CJK characters HOT 1
- auto show preview to side triggered when editing markdown cell in jupyter notebook HOT 1
- Custom section number format configuration HOT 2
- Toggle checkbox keybinding no longer works in version 3.6.0 or newer HOT 8
- Autokey abbreviations are not expanding as expected when vscode-markdown is enabled HOT 1
- Incorrect link to heading that contains image HOT 1
- GFM alerts don't look as good as expected when exporting HTML HOT 2
- jittery input HOT 1
- Remove from TOC using a REGEX or pattern match HOT 1
- GFM Alerts should be case insensitive to match GitHub HOT 2
- i cant copy image in preview HOT 1
- If user can see the outline of a previewed markdown file . That will be so useful ! HOT 1
- Remove "paste link onto text" feature
- Compatible GitHub Action for TOC enforcement HOT 3
- Call command "Update Section numbers" automatically with save of document HOT 1
- Showing "Running File Delete Participants" HOT 1
- Option to Ignore Icons in Table of Contents from formatter HOT 1
- trust option for katex to show an image in html HOT 2
- In preview, display the Mathematica code in a more readable way HOT 1
- Backspace and Enter Stopped working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-markdown.