vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Markdown preview does not toggle as expected in tabs

Open tedhudek opened this issue 10 years ago • 6 comments

  • VSCode Version: 1.3.0-insider (commit de66522, 2016-06-24)
  • OS Version: Win10

Steps to Reproduce:

  1. Use 'code-insiders .' to open a repo.
  2. Click an md file to open it. Type some text into the file.
  3. Click another md file. It opens in a new tab.
  4. CTRL+SHIFT+V to preview the second file.
  5. Three tabs are now open, two raw md and the one with a preview of the second md.
  6. Now click tab 1.
  7. Now click tab 3.
  8. CTRL+SHIFT+V.

Expected: we go back to tab 2, because that is the raw md for the file previewed in tab 3. Actual: we go back to tab 1, which is raw md for a completely different file. @gregvanl this is the issue we discussed.

tedhudek avatar Jun 25 '16 00:06 tedhudek

It looks as if this action is simply going back 1 in history? That is not really what should happen if you want to go back to source.

bpasero avatar Jun 26 '16 07:06 bpasero

Yes, we go one back in history. There is no API for extensions at the moment to get access to the editor showing an html preview. Although this behavior is wrong in some cases, we at least support the switching back and forth between source and preview.

kieferrm avatar Jun 27 '16 16:06 kieferrm

@kieferrm going back to the source should just be a call to opening the editor with the path of the markdown file, no?

bpasero avatar Jun 27 '16 16:06 bpasero

@bpasero When the command is executed, the command can not find out for which editor it has been called. The extension API returns all active text editors but the preview editor is not one of them.

kieferrm avatar Jun 27 '16 21:06 kieferrm

Oh ok, that is indeed a problem...

bpasero avatar Jun 28 '16 04:06 bpasero

I believe this is the same problem as #16298. A fix was checked in and should be available in the next insiders build

mjbvz avatar Dec 01 '16 22:12 mjbvz