add_goto_window: pass len of list and use min()

With less than `g:jedi#quickfix_window_height` entries in quickfix list,
this now only makes the window that large, effectively saving screen
space.
This commit is contained in:
Daniel Hahler
2015-04-08 16:10:56 +02:00
parent d65c35a69d
commit a233d603e3
2 changed files with 4 additions and 3 deletions

View File

@@ -236,7 +236,7 @@ def goto(is_definition=False, is_related_name=False, no_output=False):
lnum=d.line, col=d.column + 1,
text=PythonToVimStr(d.description)))
vim_eval('setqflist(%s)' % repr(lst))
vim_eval('jedi#add_goto_window()')
vim_eval('jedi#add_goto_window(' + str(len(lst)) + ')')
return definitions