iamcco / markdown-preview.nvim

markdown preview plugin for (neo)vim
MIT License
6.76k stars 280 forks source link

some times it will lose the connection #107

Closed XDID closed 4 years ago

iamcco commented 4 years ago

Any way to reproduce ?

stevenwalton commented 4 years ago

Edited because I found a reproduction method.

I'm experiencing this problem as well.

I am able to reproduce the effect with buffers. So here's the setup Split your session: Markdown in one pane and another file in the other pane (I'm using a python file for what it's worth). Start MarkdownPreview in the MD file (add text). Move panes. Move back. Session is crashed.

$ vim test.md
i hello world
<C-[>
:MarkdownPreview
:Vex
<C-w> l " move back to test.md

If you can tell me how to produce a log (I'm naive when it comes to vimscript) I am happy to add that as well.

Environment: vim cli Firefox 71 Ubuntu 18.04

iamcco commented 4 years ago

@stevenwalton You should set let g:mkdp_auto_close = 0 to disable auto close by switch buffer.

stevenwalton commented 4 years ago

That solves the issue for me. I'm not sure if this explains all the random stops so give me 24hrs before marking as resolved. But this probably resolves the issue.

side notes: 1) is there a help page? :help mkdp and :help MarkdownPreview don't exist.

2) should this variable default to 0? I'm not sure what workflows are like in neovim, but a workflow in vim your open buffers should be things you're working on. So it should close when the buffer quits, but not because you're switching buffers (kinda defeats the purpose of panes, buffers, and tabs).

stevenwalton commented 4 years ago

I'm confident that this was the error now. I haven't experienced any dropping since setting auto close to 0.

iamcco commented 4 years ago

should this variable default to 0?

Will not change the default since it will effect many user. If use chrome it will close the preview page, but for firefox you have to change firefox settings to allow javascript to close web page. So the default behavior for firefox seems that it will lose connection that switch buffer when the option on.

iamcco commented 4 years ago

Close, reopen if you still have the problem.