1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-04-14 15:19:12 +08:00

Fix SPC j S for cpp (#2929)

close #2900
This commit is contained in:
Wang Shidong 2019-07-07 11:46:26 +08:00 committed by GitHub
parent 88cba94a09
commit a96c9b8ab3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -410,8 +410,15 @@ function! s:split_string(newline) abort
endif
endfunction
" @toto add sting highlight for other filetype
let s:string_hi = {
\ 'c' : 'cCppString',
\ 'cpp' : 'cCppString',
\ }
function! s:is_string(l, c) abort
return synIDattr(synID(a:l, a:c, 1), 'name') == &filetype . 'String'
return synIDattr(synID(a:l, a:c, 1), 'name') == get(s:string_hi, &filetype, &filetype . 'String')
endfunction
" function() wrapper