forked from VimPlug/jedi
position of func_def window stays now the same
This commit is contained in:
6
api.py
6
api.py
@@ -119,7 +119,7 @@ class CallDef(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def params(self):
|
def params(self):
|
||||||
if isinstance(self.executable, evaluate.Function):
|
if self.executable.isinstance(evaluate.Function):
|
||||||
return self.executable.params
|
return self.executable.params
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@@ -128,6 +128,10 @@ class CallDef(object):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@property
|
||||||
|
def bracket_start(self):
|
||||||
|
return self.call.name.end_pos
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<%s: %s index %s>' % (self.__class__.__name__, self.executable,
|
return '<%s: %s index %s>' % (self.__class__.__name__, self.executable,
|
||||||
self.index)
|
self.index)
|
||||||
|
|||||||
@@ -511,16 +511,16 @@ def _goto(is_definition=False, is_related_name=False, no_output=False):
|
|||||||
|
|
||||||
|
|
||||||
def show_func_def(call_def, completion_lines=0):
|
def show_func_def(call_def, completion_lines=0):
|
||||||
row, column = vim.current.window.cursor
|
|
||||||
vim.eval('jedi#clear_func_def()')
|
vim.eval('jedi#clear_func_def()')
|
||||||
|
|
||||||
if call_def is None:
|
if call_def is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
row, column = call_def.bracket_start
|
||||||
if column < 2 or row == 0:
|
if column < 2 or row == 0:
|
||||||
return # edge cases, just ignore
|
return # edge cases, just ignore
|
||||||
|
|
||||||
row_to_replace = row - 1
|
row_to_replace = row - 1 # TODO check if completion menu is above or below
|
||||||
line = vim.eval("getline(%s)" % row_to_replace)
|
line = vim.eval("getline(%s)" % row_to_replace)
|
||||||
|
|
||||||
insert_column = column - 2 # because it has stuff at the beginning
|
insert_column = column - 2 # because it has stuff at the beginning
|
||||||
|
|||||||
Reference in New Issue
Block a user