mirror of
https://github.com/prabirshrestha/asyncomplete.vim.git
synced 2025-12-14 20:35:41 +01:00
add b:asyncomplete_refresh_always (#298)
This commit is contained in:
@@ -274,6 +274,7 @@ function! s:on_change() abort
|
|||||||
else
|
else
|
||||||
let l:triggered_sources = {}
|
let l:triggered_sources = {}
|
||||||
endif
|
endif
|
||||||
|
let l:refresh_always = get(b:, 'asyncomplete_refresh_always', 0)
|
||||||
let l:refresh_pattern = get(b:, 'asyncomplete_refresh_pattern', '\(\k\+$\)')
|
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)
|
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.
|
" the matches from the source.
|
||||||
if exists('l:startcol') && l:endidx - l:startidx >= s:get_min_chars(l:source_name)
|
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
|
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
|
endif
|
||||||
else
|
else
|
||||||
if has_key(s:matches, l:source_name)
|
if has_key(s:matches, l:source_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user