mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-07 19:24:36 +08:00
Fix autocmd error in Vim <7.3.867
This commit is contained in:
@@ -157,8 +157,10 @@ endfunction
|
|||||||
function! jedi#configure_call_signatures()
|
function! jedi#configure_call_signatures()
|
||||||
if g:jedi#show_call_signatures == 2 " Command line call signatures
|
if g:jedi#show_call_signatures == 2 " Command line call signatures
|
||||||
" Need to track changes to avoid multiple undo points for a single edit
|
" Need to track changes to avoid multiple undo points for a single edit
|
||||||
|
if v:version >= 704 || has("patch-7.3.867")
|
||||||
let b:normaltick = b:changedtick
|
let b:normaltick = b:changedtick
|
||||||
autocmd TextChanged,InsertLeave,BufWinEnter <buffer> let b:normaltick = b:changedtick
|
autocmd TextChanged,InsertLeave,BufWinEnter <buffer> let b:normaltick = b:changedtick
|
||||||
|
endif
|
||||||
autocmd InsertEnter <buffer> let g:jedi#first_col = s:save_first_col()
|
autocmd InsertEnter <buffer> let g:jedi#first_col = s:save_first_col()
|
||||||
endif
|
endif
|
||||||
autocmd InsertLeave <buffer> Python jedi_vim.clear_call_signatures()
|
autocmd InsertLeave <buffer> Python jedi_vim.clear_call_signatures()
|
||||||
@@ -203,7 +205,7 @@ function! s:save_first_col()
|
|||||||
" If the event that triggered InsertEnter made a change (e.g. open a
|
" If the event that triggered InsertEnter made a change (e.g. open a
|
||||||
" new line, substitude a word), join that change with the rest of this
|
" new line, substitude a word), join that change with the rest of this
|
||||||
" edit.
|
" edit.
|
||||||
if b:normaltick != b:changedtick
|
if exists('b:normaltick') && b:normaltick != b:changedtick
|
||||||
try
|
try
|
||||||
undojoin
|
undojoin
|
||||||
catch /^Vim\%((\a\+)\)\=:E790/
|
catch /^Vim\%((\a\+)\)\=:E790/
|
||||||
|
|||||||
Reference in New Issue
Block a user