liuchengxu / vista.vim

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

Some of the errors reported when used in markdown #384

Open pittcat opened 3 years ago

pittcat commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

Environment:

Vista info

Current FileType: vista_markdown
Avaliable Executives: ['coc', 'ctags']
    Global Variables:
    let g:vista = {'get_tagline_under_cursor': function('52'), 'winnr': function('50'), 'floating_visible': v:false, 'source': {'fpath': '/home/pittcat/test.md', 'bufnr': 3, 'get_winid': function('54'), 'fname': '/home/pittcat/test.md', 'winnr': 1, 'extension': function('59'), 'line': function('57'), 'get_winnr': function('53'), 'filetype': function('55'), 'lines': function('56'), 'winid': 1000, 'line_trimmed': function('58'), 'scope_seperator': function('60')}, 'bufnr': 4, 'provider': 'markdown', 'ctags_cmd': 'ctags --format=2 --excmd=pattern --fields=nksSaf --extras=+F --sort=no --append=no --extras=   --output-format=json --fields=-PF -f- /home/pittcat/.cache/nvim/vista/c6d3e476a53f38b8ea15fc9823bcd73bebdfa7851dc258bffa1183f714709c83.startify', 'winid': 1002, 'tmps': [], 'pos': [{'lnum': 1, 'leftcol': 0, 'col': 0, 'topfill': 0, 'topline': 1, 'coladd': 0, 'skipcol': 0, 'curswant': 0}, 1, '1resize 34|vert 1resize 40|2resize 34|vert 2resize 31|3resize 1|vert 3resize 40|']}
    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#enable_icon = 1
    let g:vista#renderer#icons = {'function': '', 'variable': ''}
    let g:vista_blink = [2, 100]
    let g:vista_close_on_fzf_select = 0
    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_enable_centering_jump = 1
    let g:vista_executive_for = {'go': 'coc', 'c': 'coc', 'cpp': 'coc', 'python': 'coc'}
    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 = 0
    let g:vista_sidebar_position = 'vertical topleft'
    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

source file for reproduce the ctags issue:

minimal vimrc (neccessary when this issue is about some Vim LSP client):

let g:vista_sidebar_position = 'vertical topleft'
let g:vista_sidebar_width = 40
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]
let g:vista_default_executive = 'ctags'
let g:vista_executive_for = {
  \ 'cpp': 'coc',
  \ 'c': 'coc',
  \ 'go': 'coc',
  \ 'python': 'coc',
  \ }
let g:vista#renderer#enable_icon = 1
let g:vista#renderer#icons = {
\   "function": "\uf794",
\   "variable": "\uf71b",
\  }
function! NearestMethodOrFunction() abort
  return get(b:, 'vista_nearest_method_or_function', '')
endfunction

set statusline+=%{NearestMethodOrFunction()}

" By default vista.vim never run if you don't call it explicitly.
"
" If you want to show the nearest function in your statusline automatically,
" you can add the following line to your vimrc 
autocmd VimEnter * call vista#RunForNearestMethodOrFunction()

Screenshot or gif (if possible) https://asciinema.org/a/D4aDiiajJTGAdP5b7ZgxjmPKu

pittcat commented 3 years ago

It seems like that vista_enable_markdown_extension = 0 can't disable the markdown extension. At same time, vista markdown extension is always buggy as above.

pittcat commented 3 years ago

I located the error of Vista fzf ctags is generated because the markdown heading is too long. Is there a workaround?

pittcat commented 3 years ago

Error info of Vista fzf ctags is as follow:

Error detected while processing function 83[30]..<SNR>186_callback:                                                                                                                       
line   23:
Vim(let):E684: list index out of range: 1