math2001 / MarkdownLivePreview

A Sublime Text 3 plugin to preview your markdown as you type
https://math2001.github.io/MarkdownLivePreview
MIT License
304 stars 37 forks source link

question: open in a tab not in a new window #13

Open damko opened 7 years ago

damko commented 7 years ago

lovely plugin! However I'd love to see the preview (optionally) in a new tab instead of a new window. Is it possible by any chance? The annoying thing is the fact that the source file (I mean the text view) is moved to the new window and when closing the window I also close the source file (as specified in the README). Is there any workaround? It would be good enough to quickly bring back the source file from the original st3 window

math2001 commented 7 years ago

Thanks!

Opening the preview in a new tab makes Sublime Text crash, because you need to close/open it when the markdown view is focused. It's what was happening in the v1.x.

Is it possible by any chance?

Maybe, but it's not going to be soon...

The annoying thing is the fact that the source file (I mean the text view) is moved to the new window and when closing the window I also close the source file (as specified in the README).

I could add a settings keep_open_when_opening_preview for example to not close the original view when you open the preview window. Is that what you need?

math2001 commented 7 years ago

Hello?

alvianx commented 7 years ago

There's a bug when you enable markdown_live_preview_on_open and keep_open_when_opening_preview. It keep opening a new window when you click or focus on the original source file.

Can you check if it's already opened then don't open a new window?

Also you can set "show_sidebar": false, to hide the sidebar btw😁

math2001 commented 7 years ago

Can you check if it's already opened then don't open a new window?

Sure! I'll have a look!

Also you can set "show_sidebar": false, to hide the sidebar btw😁

It's already working, i think... I'll check in a sec

math2001 commented 7 years ago

I pushed a new commit, which should fix this. There's still a problem though: if, when you close the preview window, the previously focused window was ST with the markdown view, it's going to reopen it.

aurimus commented 7 years ago

@math2001 I read there is crash limitation, wonder if it applies to #22 (opening preview only)

math2001 commented 7 years ago

No it doesn't: it crashes because the focus swaps too quickly between the 2 views.

math2001 commented 7 years ago

No it doesn't: it crashes because the focus swaps too quickly between the 2 views.

This was with Sublime Text 3 in beta... Need to give it another crack at it now that it's stable. It's going to be the V3.