Fix jedi#add_goto_window: use :copen to go to the qf window always

Without this it would not go there with an already open qf window, and
would go to an unexpected buffer line instead of selecting the entry.

This is a follow-up to b689409, where it was decided that it should
always require the user to select an entry.

An exception is when the same usages are used again: then it will select
the nearest/current entry only (via ":cc").
This commit is contained in:
Daniel Hahler authored and Dave Halter committed 2020-02-27 20:41:45 +01:00
1 parent 055199f2aa
commit 686f39ac00
2 files changed
+17 -25

No files matched your search

+2 -2
View File
@@ -473,12 +473,12 @@ def show_goto_multi_results(definitions, mode):
and VimCompat.can_update_current_qflist_for_context(qf_context)):
# Same list, only adjust title/selected entry.
VimCompat.setqflist_title(qf_title)
vim_command('%dcc' % select_entry)
else:
VimCompat.setqflist(lst, title=qf_title, context=qf_context)
for_usages = mode == "usages"
vim_eval('jedi#add_goto_window(%d, %d)' % (for_usages, len(lst)))
vim_command('%d' % select_entry)
vim_command('%d' % select_entry)
def _same_definitions(a, b):