Merge pull request #121 from jsit/popup-delay-v2

* Add popup delay option
* Add popup delay documentation
This commit is contained in:
Prabir Shrestha
2019-03-03 10:55:16 -08:00
committed by GitHub
4 changed files with 18 additions and 1 deletions

View File

@@ -51,6 +51,15 @@ inoremap <silent><expr> <TAB>
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
```
### Popup delay
By default asyncomplete will show the autocomplete popup menu after a 30ms
delay. Change this value to cause the popup to show more or less quickly between
keystrokes.
```vim
let g:asyncomplete_popup_delay = 30
```
### Remove duplicates
If you have many sources enabled (especially the buffer source), it might be

View File

@@ -333,7 +333,7 @@ function! s:update_pum() abort
unlet s:update_pum_timer
endif
call asyncomplete#log('core', 's:update_pum')
let s:update_pum_timer = timer_start(30, function('s:recompute_pum'))
let s:update_pum_timer = timer_start(g:asyncomplete_popup_delay, function('s:recompute_pum'))
endfunction
function! s:recompute_pum(...) abort

View File

@@ -35,6 +35,13 @@ g:asyncomplete_log_file *g:asyncomplete_log_file*
Path to log file.
g:asyncomplete_popup_delay *g:asyncomplete_popup_delay*
Type: |Number|
Default: 30
Milliseconds to wait before opening the popup menu
g:asyncomplete_auto_completeopt *g:asyncomplete_auto_completeopt*
Type: |Number|

View File

@@ -16,6 +16,7 @@ let g:asyncomplete_triggers = get(g:, 'asyncomplete_triggers', {'*': ['.', '>',
let g:asyncomplete_auto_completeopt = get(g:, 'asyncomplete_auto_completeopt', 1)
let g:asyncomplete_auto_popup = get(g:, 'asyncomplete_auto_popup', 1)
let g:asyncomplete_popup_delay = get(g:, 'asyncomplete_popup_delay', 30)
let g:asyncomplete_log_file = get(g:, 'asyncomplete_log_file', '')
inoremap <silent> <expr> <Plug>(asyncomplete_force_refresh) asyncomplete#force_refresh()