markdown-preview.nvim icon indicating copy to clipboard operation
markdown-preview.nvim copied to clipboard

[Help] preview html function not work after a quit command

Open roachsinai opened this issue 5 years ago • 2 comments

This plugin works well for normal use. But I have a special situation that the markdown file to preview is created by other command.

So I just don't want to see the temporary markdown file, only want to check the preview created by this plugin.

I want to use a vimL function to do this:

function! PreviewJupyterMD()
	command that create a md file and load it to a buffer
    call mkdp#util#open_preview_page()
    exec ":q"
endfunction

But if I add exec ":q" to this function, seems only load the file but not turn it to html.

image

After I delete exec ":q", all good.

image

But I do wanna delete the buffer/window by function.

Thanks in advance!

roachsinai avatar Sep 08 '20 16:09 roachsinai

call mkdp#util#open_preview_page() is async, and :q will change the current buffer. I don't know if it's the reason. If it's the reason then need some work to support that.

iamcco avatar Sep 15 '20 08:09 iamcco

Seems right, change :q to :buffer 2 get same result.

roachsinai avatar Sep 15 '20 12:09 roachsinai