mirror of
https://github.com/davidhalter/jedi-vim.git
synced 2025-12-09 03:54:52 +08:00
Remove manual width calculation and handle horizontal scroll
This commit is contained in:
@@ -168,9 +168,9 @@ endfunction
|
|||||||
" Determine where the current window is on the screen for displaying call
|
" Determine where the current window is on the screen for displaying call
|
||||||
" signatures in the correct column.
|
" signatures in the correct column.
|
||||||
function! s:save_first_col()
|
function! s:save_first_col()
|
||||||
let gutterwidth = &fdc + &number * max([&numberwidth, len(line('$')) + 1])
|
if bufname('%') ==# '[Command Line]' || winnr('$') == 1
|
||||||
if bufname('%') ==# '[Command Line]' | return gutterwidth + 1 | endif
|
return 0
|
||||||
if winnr('$') == 1 | return gutterwidth | endif
|
endif
|
||||||
|
|
||||||
let l:eventignore = &eventignore
|
let l:eventignore = &eventignore
|
||||||
set eventignore=all
|
set eventignore=all
|
||||||
@@ -182,7 +182,7 @@ function! s:save_first_col()
|
|||||||
wincmd h
|
wincmd h
|
||||||
let win_on_left = winnr() == startwin
|
let win_on_left = winnr() == startwin
|
||||||
if win_on_left
|
if win_on_left
|
||||||
return gutterwidth
|
return 0
|
||||||
else
|
else
|
||||||
" Walk left and count up window widths until hitting the edge
|
" Walk left and count up window widths until hitting the edge
|
||||||
execute startwin."wincmd w"
|
execute startwin."wincmd w"
|
||||||
@@ -194,7 +194,7 @@ function! s:save_first_col()
|
|||||||
let winnr = winnr()
|
let winnr = winnr()
|
||||||
wincmd h
|
wincmd h
|
||||||
endwhile
|
endwhile
|
||||||
return width + gutterwidth
|
return width
|
||||||
endif
|
endif
|
||||||
finally
|
finally
|
||||||
let &eventignore = l:eventignore
|
let &eventignore = l:eventignore
|
||||||
|
|||||||
@@ -341,7 +341,8 @@ def cmdline_call_signatures(signatures):
|
|||||||
if max_num_spaces < 0:
|
if max_num_spaces < 0:
|
||||||
return # No room for the message
|
return # No room for the message
|
||||||
_, column = signatures[0].bracket_start
|
_, column = signatures[0].bracket_start
|
||||||
num_spaces = min(int(vim_eval('g:jedi#first_col')) +
|
num_spaces = min(int(vim_eval('g:jedi#first_col +'
|
||||||
|
'wincol() - col(".")')) +
|
||||||
column - len(signatures[0].call_name),
|
column - len(signatures[0].call_name),
|
||||||
max_num_spaces)
|
max_num_spaces)
|
||||||
spaces = ' ' * num_spaces
|
spaces = ' ' * num_spaces
|
||||||
|
|||||||
Reference in New Issue
Block a user