waylan / vim-markdown-extra-preview

A Python port of vim-markdown-preview that utilizes Python-Markdown's 'extra' extension.
17 stars 7 forks source link

Corrupted window content on `:Me` #16

Open dpc opened 10 years ago

dpc commented 10 years ago

When I do :Me I'll get this:

Created new window in existing browser session.

displayed which corrupt the view of the window.

Obviously it's a message displayed by chrome/chromium on start. The quickest way to get it back to normal is :redraw!. But I guess this should be fixed.

waylan commented 10 years ago

I'm sorry but I'm a little confused. Do you mean that the vim window needs refreshed? I suppose we could add a call to :redraw at the end if the function. Or do you mean the browser window needs refreshed?

dpc commented 10 years ago

Vim window get's polluted with stdout/stderr of the browser. The best fix would be send stdout/stderr of spawned browser to /dev/null, but I guess :redraw! could be some solution too.

waylan commented 10 years ago

Okay, i understand your problem now, but I'm curious what errors you are getting as we use the webbrowser package which should be catching any OSError. What happens if you do the following from Python:

>>> import webbrowser
>>> webbrowser.open("/path/to/a/file.html")

And how about (note the use of "file:///"):

>>> webbrowser.open("file:///path/to/a/file.html")

Could you paste in whatever you get from those? Thanks.

dpc commented 10 years ago
% python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> webbrowser.open("x.html")
True
>>> Created new window in existing browser session.

I guess webbrowser package is not handling stderr/stdout of a starting process.