From 87eb253ce86bf9ec675c3f430b1fc22f36d126b1 Mon Sep 17 00:00:00 2001 From: mattn Date: Sat, 18 Oct 2025 17:42:27 +0900 Subject: [PATCH] add b:asyncomplete_refresh_always (#298) --- autoload/asyncomplete.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/asyncomplete.vim b/autoload/asyncomplete.vim index d5e4e4b..8c213d6 100644 --- a/autoload/asyncomplete.vim +++ b/autoload/asyncomplete.vim @@ -274,6 +274,7 @@ function! s:on_change() abort else let l:triggered_sources = {} endif + let l:refresh_always = get(b:, 'asyncomplete_refresh_always', 0) let l:refresh_pattern = get(b:, 'asyncomplete_refresh_pattern', '\(\k\+$\)') let [l:_, l:startidx, l:endidx] = asyncomplete#utils#matchstrpos(l:ctx['typed'], l:refresh_pattern) @@ -294,7 +295,7 @@ function! s:on_change() abort " the matches from the source. if exists('l:startcol') && l:endidx - l:startidx >= s:get_min_chars(l:source_name) if !has_key(s:matches, l:source_name) || s:matches[l:source_name]['ctx']['lnum'] !=# l:ctx['lnum'] || s:matches[l:source_name]['startcol'] !=# l:startcol - let s:matches[l:source_name] = { 'startcol': l:startcol, 'status': 'idle', 'items': [], 'refresh': 0, 'ctx': l:ctx } + let s:matches[l:source_name] = { 'startcol': l:startcol, 'status': 'idle', 'items': [], 'refresh': l:refresh_always, 'ctx': l:ctx } endif else if has_key(s:matches, l:source_name)