timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 75 forks source link

Browser preview when switching projects. #16

Closed vpalos closed 11 years ago

vpalos commented 11 years ago

The Browser preview stops working (i.e. stops updating, disconnects) when switching the active project in ST2.

timonwong commented 11 years ago

So I need to implement permanent url scheme, which won't be affected by ST2 restarting, or project switching.

I'll find a way to achieve that properly, it may take some time since it affect a lot of code.

vpalos commented 11 years ago

I think that making it work even when restarting ST2 may be too much. I do not know the internals if ST2 so I don't know, but is it still complicated if you only fix it for project switching? That is what's important in the end. If the user closes ST2 then he probably expects that everything that was connected to it will stop working (i.e. the browser preview) so that is OK in my opinion, but some users (like me) switch projects quite often during workflow and that is the situation where this should keep working.

timonwong commented 11 years ago

The main problem is, this plugin relies heavily on buffer ids of ST2, and what the live preview do is just query by the buffer id from the cache. Thus, there is not so much differences between restarting and project switching, because buffer id will be no more valid after file closed. Therefore I consider it a design issue (I didn't realize that buffer ids are so unstable when I wrote this plugin), and decide to change that.

timonwong commented 11 years ago

@valeriupalos Hi, I've made progress in the feature-revive_buffer branch, reconnected view will automatically redirect to the new location. Check out feature-revive_buffer branch to if you want to have a try.

timonwong commented 11 years ago

Should be done in v2.0, feel free to fire a new issue if anything broken...