From 5c3bdc07937ef5591e5abf3dfbd765fb905c452d Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Tue, 21 May 2024 17:33:35 +0800 Subject: [PATCH] fix(util): timer to open file in vim (#5016) Closes #5011 --- autoload/coc/util.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/coc/util.vim b/autoload/coc/util.vim index 0ebeeaa5f39..0c2a336a9dd 100644 --- a/autoload/coc/util.vim +++ b/autoload/coc/util.vim @@ -172,7 +172,11 @@ function! coc#util#jump(cmd, filepath, ...) abort elseif a:cmd ==# 'edit' && bufloaded(file) exe 'b '.bufnr(file) else - call s:safer_open(a:cmd, file) + if s:is_vim + call timer_start(10, { -> s:safer_open(a:cmd, file)}) + else + call s:safer_open(a:cmd, file) + endif endif if !empty(get(a:, 1, [])) let line = getline(a:1[0] + 1)