instant-markdown/vim-instant-markdown

Closes on leave and doesn't reopen

Closed this issue · 6 comments

If I

  1. Open a markdown file and get a preview tab in Chrome
  2. :e a different, non-markdown file
  3. Then :b 1 to come back to the markdown file

The Chrome tab is closed and doesn't reopen. I see there is a BufWinLeave/BufWinEnter pair in the plugin, so I'm wondering if the tab closes on BufWinLeave and then doesn't reopen on enter because it's spelled BufwinEnter (with lower case "w") here.

Related, I think it would be nice if you could create the InstantMarkdownPreview command regardless of whether g:instant_markdown_autostart is set, so that if for some reason the Chrome tab does get closed, there's a way to reopen it that's not "exit vim and reopen that markdown file."

I just tried, locally, changing that to a capital "w," and it didn't make a difference. So editing another file definitely closes the preview, and then there's literally no way to bring it back except exiting vim.

curl maybe not install, problem maybe none after you installed curl .

What? I definitely have curl. It all works fine when you open a file for the first time. It's just when you close it that there's a problem.

just :e in vim

On #147 there was a fix for the preview to persist on buffer switch. That should have fixed the main issue. I will fix the typo.

The browser opening is currently handled by the node server, I will see if the command can be made visible at all times.