liuchengxu / vista.vim

:cactus: Viewer & Finder for LSP symbols and tags
https://liuchengxu.github.io/vista.vim
MIT License
1.89k stars 87 forks source link

Vista focus won't jump back to the source window #347

Closed eulertour closed 4 years ago

eulertour commented 4 years ago

Running :Vista focus from the Vista tab doesn't jump to the source window.

Environment:

Vista info

 Vista info
    Current FileType: vista
Avaliable Executives: ['coc', 'ctags']
    Global Variables:
    let g:vista = {'winnr': function('283'), 'tree': {}, 'source': {'fpath': '/home/devneal/github/manim/__vista__', 'bufnr': 20, 'get_winid': function('287'), 'fname': '__vista__', 'winnr': 3, 'extension': function('292'), 'line': f
unction('290'), 'get_winnr': function('286'), 'filetype': function('288'), 'lines': function('289'), 'winid': 1006, 'line_trimmed': function('291'), 'scope_seperator': function('293')}, 'without_scope': [{'name': 'CairoRenderer', 'vl
num': 3, 'line': 6, '_type': 'tag', 'kind': 'class', 'access': 'public'}], 'get_tagline_under_cursor': function('285'), 'provider': 'ctags', 'with_scope': [{'scopeKind': 'class', 'signature': '(self, scene, camera, file_writer)', 'vl
num': 4, 'name': '__init__', 'scope': 'CairoRenderer', 'line': 7, '_type': 'tag', 'kind': 'member', 'access': 'public'}, {'scopeKind': 'class', 'signature': '( self, mobjects=None, background=None, include_submobjects=True, ignore_sk
ipping=True, **kwargs, )', 'vlnum': 5, 'name': 'update_frame', 'scope': 'CairoRenderer', 'line': 12, '_type': 'tag', 'kind': 'member', 'access': 'public'}, {'scopeKind': 'class', 'signature': '(self)', 'vlnum': 6, 'name': 'get_frame'
, 'scope': 'CairoRenderer', 'line': 52, '_type': 'tag', 'kind': 'member', 'access': 'public'}], 'functions': [{'lnum': 7, 'text': '__init__', 'signature': '(self, scene, camera, file_writer)'}, {'lnum': 12, 'text': 'update_frame', 's
ignature': '( self, mobjects=None, background=None, include_submobjects=True, ignore_skipping=True, **kwargs, )'}, {'lnum': 52, 'text': 'get_frame', 'signature': '(self)'}], 'raw': [{'name': 'CairoRenderer', 'vlnum': 3, 'line': 6, '_
type': 'tag', 'kind': 'class', 'access': 'public'}, {'scopeKind': 'class', 'signature': '(self, scene, camera, file_writer)', 'vlnum': 4, 'name': '__init__', 'scope': 'CairoRenderer', 'line': 7, '_type': 'tag', 'kind': 'member', 'acc
ess': 'public'}, {'scopeKind': 'class', 'signature': '( self, mobjects=None, background=None, include_submobjects=True, ignore_skipping=True, **kwargs, )', 'vlnum': 5, 'name': 'update_frame', 'scope': 'CairoRenderer', 'line': 12, '_t
ype': 'tag', 'kind': 'member', 'access': 'public'}, {'scopeKind': 'class', 'signature': '(self)', 'vlnum': 6, 'name': 'get_frame', 'scope': 'CairoRenderer', 'line': 52, '_type': 'tag', 'kind': 'member', 'access': 'public'}], 'kinds':
 ['class', 'member'], 'ctags_cmd': 'ctags --format=2 --excmd=pattern --fields=nksSaf --extras=+F --sort=no --append=no --extras=  --language-force=python --python-kinds=cvfim --output-format=json --fields=-PF -f- /home/devneal/.cache
/nvim/vista/fed18ef602f28c33eac8dbe05197519054937ae9b0ab2c37ed09dca871d6f599.py', 'bufnr': 20, 'raw_by_kind': {'class': [{'name': 'CairoRenderer', 'vlnum': 3, 'line': 6, '_type': 'tag', 'kind': 'class', 'access': 'public'}], 'member'
: [{'scopeKind': 'class', 'signature': '(self, scene, camera, file_writer)', 'vlnum': 4, 'name': '__init__', 'scope': 'CairoRenderer', 'line': 7, '_type': 'tag', 'kind': 'member', 'access': 'public'}, {'scopeKind': 'class', 'signatur
e': '( self, mobjects=None, background=None, include_submobjects=True, ignore_skipping=True, **kwargs, )', 'vlnum': 5, 'name': 'update_frame', 'scope': 'CairoRenderer', 'line': 12, '_type': 'tag', 'kind': 'member', 'access': 'public'
}, {'scopeKind': 'class', 'signature': '(self)', 'vlnum': 6, 'name': 'get_frame', 'scope': 'CairoRenderer', 'line': 52, '_type': 'tag', 'kind': 'member', 'access': 'public'}]}, 'tmps': ['/home/devneal/.cache/nvim/vista/fed18ef602f28c
33eac8dbe05197519054937ae9b0ab2c37ed09dca871d6f599.py', '/home/devneal/.cache/nvim/vista/fed18ef602f28c33eac8dbe05197519054937ae9b0ab2c37ed09dca871d6f599.py', '/home/devneal/.cache/nvim/vista/3a74a43321877828c7e263064df27f0c118cc6366
835f61772a2a697fe5bbb15.vim', '/home/devneal/.cache/nvim/vista/fed18ef602f28c33eac8dbe05197519054937ae9b0ab2c37ed09dca871d6f599.py', '/home/devneal/.cache/nvim/vista/3a74a43321877828c7e263064df27f0c118cc6366835f61772a2a697fe5bbb15.vi
m', '/home/devneal/.cache/nvim/vista/3a74a43321877828c7e263064df27f0c118cc6366835f61772a2a697fe5bbb15.vim', '/home/devneal/.cache/nvim/vista/3a74a43321877828c7e263064df27f0c118cc6366835f61772a2a697fe5bbb15.vim', '/home/devneal/.cache
/nvim/vista/3a74a43321877828c7e263064df27f0c118cc6366835f61772a2a697fe5bbb15.vim', '/home/devneal/.cache/nvim/vista/fed18ef602f28c33eac8dbe05197519054937ae9b0ab2c37ed09dca871d6f599.py'], 'pos': [{'lnum': 1, 'leftcol': 0, 'col': 0, 't
opfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, 3, '1resize 48|vert 1resize 116|2resize 48|vert 2resize 75|3resize 48|vert 3resize 40|'], 'floating_visible': v:false, 'vlnum_cache': [{'name': 'CairoRenderer', 'vl
num': 3, 'line': 6, '_type': 'tag', 'kind': 'class', 'access': 'public'}, {'scopeKind': 'class', 'signature': '(self, scene, camera, file_writer)', 'vlnum': 4, 'name': '__init__', 'scope': 'CairoRenderer', 'line': 7, '_type': 'tag',
'kind': 'member', 'access': 'public'}, {'scopeKind': 'class', 'signature': '( self, mobjects=None, background=None, include_submobjects=True, ignore_skipping=True, **kwargs, )', 'vlnum': 5, 'name': 'update_frame', 'scope': 'CairoRend
erer', 'line': 12, '_type': 'tag', 'kind': 'member', 'access': 'public'}, {'scopeKind': 'class', 'signature': '(self)', 'vlnum': 6, 'name': 'get_frame', 'scope': 'CairoRenderer', 'line': 52, '_type': 'tag', 'kind': 'member', 'access'
: 'public'}, ''], 'winid': 1006}
    let g:vista#executive#ctags#support_json_format = 1
    let g:vista#executives = ['ale', 'coc', 'ctags', 'lcn', 'nvim_lsp', 'vim_lsc', 'vim_lsp']
    let g:vista#extensions = ['markdown', 'rst']
    let g:vista#finders = ['clap', 'fzf', 'skim']
    let g:vista#renderer#ctags = 'default'
    let g:vista#renderer#default#vlnum_offset = 3
    let g:vista#renderer#enable_icon = 1
    let g:vista#renderer#icons = {'subroutine': '羚', 'method': '', 'func': '', 'variables': '', 'namespace': '', 'field': '', 'interface': '', 'type': '', 'packages': '', 'property': '襁', 'implementation': '', 'default': '
', 'augroup': 'פּ', 'macro': '', 'enumerator': '', 'const': '', 'macros': '', 'map': 'פּ', 'fields': '', 'functions': '', 'enum': '', 'function': '', 'target': '', 'typedef': '', 'variable': '', 'modules': '', 'constant':
'', 'struct': '', 'types': '', 'module': '', 'typeParameter': '', 'package': '', 'class': '', 'member': '', 'var': '', 'union': '鬒'}
    let g:vista_blink = [2, 100]
    let g:vista_close_on_jump = 0
    let g:vista_cursor_delay = 400
    let g:vista_default_executive = 'ctags'
    let g:vista_disable_statusline = 0
    let g:vista_echo_cursor = 1
    let g:vista_executive_for = {}
    let g:vista_find_absolute_nearest_method_or_function = 0
    let g:vista_find_nearest_method_or_function_delay = 300
    let g:vista_fold_toggle_icons = ['▼', '▶']
    let g:vista_fzf_preview = []
    let g:vista_icon_indent = ['└ ', '│ ']
    let g:vista_ignore_kinds = []
    let g:vista_no_mappings = 1
    let g:vista_sidebar_position = 'vertical botright'
    let g:vista_sidebar_width = 40
    let g:vista_stay_on_open = 1
    let g:vista_top_level_blink = [2, 100]
    let g:vista_update_on_text_changed = 0
    let g:vista_update_on_text_changed_delay = 500

Steps to reproduce given the above info

Open vim and run :Vista focus twice.

Expected behavior The first command opens the Vista sidebar and jumps to it, and the second jumps back to the source window.

Actual behavior The first command opens the Vista sidebar and jumps to it, and the second does nothing.

issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.77. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

jdhao commented 4 years ago

I also observed the same issue for :Vista focus command. It only jump to the vista window and never jump back.