1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 02:05:40 +08:00

fix(lang#c): fix g d key binding

close https://github.com/SpaceVim/SpaceVim/issues/4544
This commit is contained in:
wsdjeg 2022-04-12 22:14:46 +08:00
parent 6b357c7cde
commit d4bb45b28d

View File

@ -463,7 +463,13 @@ endfunction
" local function: go_to_declaration {{{
function! s:go_to_declaration() abort
if !SpaceVim#layers#lsp#check_filetype(&ft)
execute "norm! g\<c-]>"
try
exe 'ts' expand('<cword>')
catch /^Vim\%((\a\+)\)\=:E426/
echohl WarningMsg
echo 'tag not found: ' . expand('<cword>')
echohl NONE
endtry
else
call SpaceVim#lsp#go_to_declaration()
endif
@ -473,7 +479,13 @@ endfunction
" local function: go_to_def {{{
function! s:go_to_def() abort
if !SpaceVim#layers#lsp#check_filetype(&ft)
execute "norm! g\<c-]>"
try
exe 'ts' expand('<cword>')
catch /^Vim\%((\a\+)\)\=:E426/
echohl WarningMsg
echo 'tag not found: ' . expand('<cword>')
echohl NONE
endtry
else
call SpaceVim#lsp#go_to_def()
endif