forked from VimPlug/jedi-vim
Find first column with winwidth instead of wincmds
This commit is contained in:
@@ -341,11 +341,6 @@ endfunc
|
|||||||
|
|
||||||
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
|
|
||||||
if v:version >= 704 || has("patch-7.3.867")
|
|
||||||
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> PythonJedi jedi_vim.clear_call_signatures()
|
autocmd InsertLeave <buffer> PythonJedi jedi_vim.clear_call_signatures()
|
||||||
@@ -360,45 +355,40 @@ function! s:save_first_col()
|
|||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:eventignore = &eventignore
|
|
||||||
set eventignore=all
|
|
||||||
let startwin = winnr()
|
let startwin = winnr()
|
||||||
let startaltwin = winnr('#')
|
|
||||||
let winwidth = winwidth(0)
|
let winwidth = winwidth(0)
|
||||||
|
if winwidth == &columns
|
||||||
try
|
return 0
|
||||||
wincmd h
|
elseif winnr('$') == 2
|
||||||
let win_on_left = winnr() == startwin
|
return startwin == 1 ? 0 : (winwidth(1) + 1)
|
||||||
if win_on_left
|
elseif winnr('$') == 3
|
||||||
|
if startwin == 1
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
let ww1 = winwidth(1)
|
||||||
|
let ww2 = winwidth(2)
|
||||||
|
let ww3 = winwidth(3)
|
||||||
|
if ww1 + ww2 + ww3 + 2 == &columns
|
||||||
|
if startwin == 2
|
||||||
|
return ww1 + 1
|
||||||
|
else
|
||||||
|
return ww1 + ww2 + 2
|
||||||
|
endif
|
||||||
|
elseif startwin == 2
|
||||||
|
if ww2 + ww3 + 1 == &columns
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
" Walk left and count up window widths until hitting the edge
|
return ww1 + 1
|
||||||
execute startwin."wincmd w"
|
|
||||||
let width = 0
|
|
||||||
let winnr = winnr()
|
|
||||||
wincmd h
|
|
||||||
while winnr != winnr()
|
|
||||||
let width += winwidth(0) + 1 " Extra column for window divider
|
|
||||||
let winnr = winnr()
|
|
||||||
wincmd h
|
|
||||||
endwhile
|
|
||||||
return width
|
|
||||||
endif
|
endif
|
||||||
finally
|
else " startwin == 3
|
||||||
let &eventignore = l:eventignore
|
if ww2 + ww3 + 1 == &columns
|
||||||
execute startaltwin."wincmd w"
|
return ww2 + 1
|
||||||
execute startwin."wincmd w"
|
else
|
||||||
" If the event that triggered InsertEnter made a change (e.g. open a
|
return ww1 + 1
|
||||||
" new line, substitude a word), join that change with the rest of this
|
|
||||||
" edit.
|
|
||||||
if exists('b:normaltick') && b:normaltick != b:changedtick
|
|
||||||
try
|
|
||||||
undojoin
|
|
||||||
catch /^Vim\%((\a\+)\)\=:E790/
|
|
||||||
" This can happen if an undo happens during a :normal command.
|
|
||||||
endtry
|
|
||||||
endif
|
endif
|
||||||
endtry
|
endif
|
||||||
|
endif
|
||||||
|
return 0
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user