Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

启动preview后需要redraw #65

Open
hulucc opened this issue Aug 16, 2018 · 6 comments
Open

启动preview后需要redraw #65

hulucc opened this issue Aug 16, 2018 · 6 comments

Comments

@hulucc
Copy link

hulucc commented Aug 16, 2018

系统:win10
terminal中启动浏览器后需要手动redraw
能否改成自动刷新?

execute "silent !cmd /c start " . a:url . '.html' | execute "redraw!"

或者

execute "silent !start " . a:url . '.html'
@iamcco
Copy link
Owner

iamcco commented Aug 17, 2018

redraw 说的是打开页面没有内容?这个可能是因为 CursorHold 的时候服务还没起来,导致第一次发送的内容服务没有收到。之前只能设置 CursorHold 的时间,我试下改用 timer

@hulucc
Copy link
Author

hulucc commented Aug 17, 2018

不redraw的话vim就什么都不显示了
image

@iamcco iamcco closed this as completed in c09a1ca Aug 19, 2018
@iamcco
Copy link
Owner

iamcco commented Aug 19, 2018

完全不知道为啥会出现这个,redraw已经加上,更新试下

@iamcco iamcco reopened this Aug 19, 2018
@hulucc
Copy link
Author

hulucc commented Aug 19, 2018

image
目前更新后仍然需要手动刷新。
我研究了一下这个问题是因为启动url时:

  • 如果不加silent,会显示Press ENTER or type command to continue, 按回车后会自动刷新
  • silent后就不会显示Press ENTER or type command to continue, 需要手动刷新

相关帖子
https://stackoverflow.com/questions/890802/

@voldikss
Copy link
Contributor

voldikss commented Oct 4, 2018

我用的是 Windows gitbash,每次也需要 redraw。但是我给打开浏览器的函数增加了异步方法之后这个情况就消失了(#72),所以我觉得可能不是 启动服务器所导致 而是 打开浏览器所导致的。不知道对不对。

@hulucc
Copy link
Author

hulucc commented Oct 28, 2018

我试了下新版直接打不开了。。。

function! OpenBrowser(url)
    execute "silent !start " . a:url . '.html'
endfunction
let g:mkdp_browserfunc = 'OpenBrowser'

我现在是用自己的配置打开的

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants