Skip to content

Commit

Permalink
Avoid multi-line symbols (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
taqenoqo authored Apr 6, 2024
1 parent f76cecc commit 04fa99a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autoload/vista/parser/lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,16 @@ function! vista#parser#lsp#CocSymbols(symbol, container) abort
call add(g:vista.functions, a:symbol)
endif

let symbol_text = a:symbol.text
let line_break_position = stridx(symbol_text, "\n")
if line_break_position != -1
let symbol_text = symbol_text[ : line_break_position - 1 ]
endif

call add(a:container, {
\ 'lnum': a:symbol.lnum,
\ 'col': a:symbol.col,
\ 'text': a:symbol.text,
\ 'text': symbol_text,
\ 'kind': a:symbol.kind,
\ 'level': a:symbol.level
\ })
Expand Down

0 comments on commit 04fa99a

Please sign in to comment.