File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ if !has('nvim')
22 finish
33endif
44
5- function ! nvim_ghost#init ()
5+ function ! nvim_ghost#init (defer = 1 )
66 if ! g: nvim_ghost_use_script && (! filereadable (g: nvim_ghost_binary_path ) ||
77 \ readfile (g: nvim_ghost_installation_dir .. ' binary_version' )[0 ] !=
88 \ readfile (g: nvim_ghost_binary_path .. " .version" )[0 ]
99 \)
1010 call nvim_ghost#installer#install (function (" nvim_ghost#enable" ))
1111 else
12- call nvim_ghost#enable (1 )
12+ call nvim_ghost#enable (a: defer )
1313 endif
1414endfunction
1515
Original file line number Diff line number Diff line change @@ -51,12 +51,18 @@ endif
5151
5252" If autostart is disabled, add GhostTextStart command
5353if ! g: nvim_ghost_autostart
54- command ! GhostTextStart
55- \| call nvim_ghost#init ()
56- \| doau <nomodeline> nvim_ghost UIEnter
57- \| delcommand GhostTextStart
58- \| command GhostTextStop
59- \| call nvim_ghost#disable ()
54+ command ! GhostTextStart call s: GhostTextStart ()
55+ fun ! s: GhostTextStart ()
56+ call nvim_ghost#init (0 )
57+ doau <nomodeline> nvim_ghost UIEnter
58+ delcommand GhostTextStart
59+ command GhostTextStop call s: GhostTextStop ()
60+ endfun
61+ fun ! s: GhostTextStop ()
62+ call nvim_ghost#disable ()
63+ delcommand GhostTextStop
64+ command GhostTextStart call s: GhostTextStart ()
65+ endfun
6066 finish
6167endif
6268
You can’t perform that action at this time.
0 commit comments