Skip to content

Commit

Permalink
Handle/lock g:jedi#smart_auto_mappings_delay without timers
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jul 15, 2018
1 parent d8fb1e1 commit 01cea93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion autoload/jedi.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let s:default_settings = {
\ 'quickfix_window_height': 10,
\ 'force_py_version': "'auto'",
\ 'smart_auto_mappings': has('timers'),
\ 'smart_auto_mappings_delay': 200,
\ 'smart_auto_mappings_delay': has('timers') ? 200 : 0,
\ 'use_tag_stack': 1
\ }

Expand All @@ -52,6 +52,14 @@ for [s:key, s:val] in items(s:default_settings)
endif
endfor

if !has('timers')
if g:jedi#smart_auto_mappings != 0
echom 'jedi-vim: using g:jedi#smart_auto_mappings_delay requires the timers feature.'
let g:jedi#smart_auto_mappings_delay = 0
endif
lockvar g:jedi#smart_auto_mappings_delay
endif


" ------------------------------------------------------------------------
" Python initialization
Expand Down Expand Up @@ -212,6 +220,7 @@ function! jedi#debug_info() abort
echo "\n"
endif
verb set omnifunc? completeopt?
echo '+timers: '.has('timers')
echo '```'

if &verbose
Expand Down
2 changes: 1 addition & 1 deletion doc/jedi-vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ When you start typing `from module.name<space>` jedi-vim automatically
adds the "import" statement and displays the autocomplete popup.

When the |+timers| feature is available it gets triggered after
`g:jedi#smart_auto_mappings_delay` milliseconds (which defaults to 100).
`g:jedi#smart_auto_mappings_delay` milliseconds (which defaults to 200).
If the buffer changed until the timer times out, this gets skipped.

You can disable or configure this option in the .vimrc:
Expand Down

0 comments on commit 01cea93

Please sign in to comment.