Skip to content

Commit 2a79baa

Browse files
committed
Add jedi#setup_call_signatures, moving code from after/syntax/python.vim
1 parent 80378d8 commit 2a79baa

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

after/syntax/python.vim

+1-28
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,4 @@ if !jedi#init_python()
22
finish
33
endif
44

5-
if g:jedi#show_call_signatures > 0 && has('conceal')
6-
" +conceal is the default for vim >= 7.3
7-
8-
let s:e = g:jedi#call_signature_escape
9-
let s:full = s:e.'jedi=.\{-}'.s:e.'.\{-}'.s:e.'jedi'.s:e
10-
let s:ignore = s:e.'jedi.\{-}'.s:e
11-
exe 'syn match jediIgnore "'.s:ignore.'" contained conceal'
12-
setlocal conceallevel=2
13-
syn match jediFatSymbol "\*_\*" contained conceal
14-
syn match jediFat "\*_\*.\{-}\*_\*" contained contains=jediFatSymbol
15-
syn match jediSpace "\v[ ]+( )@=" contained
16-
exe 'syn match jediFunction "'.s:full.'" keepend extend '
17-
\ .' contains=jediIgnore,jediFat,jediSpace'
18-
\ .' containedin=pythonComment,pythonString,pythonRawString'
19-
unlet! s:e s:full s:ignore
20-
21-
hi def link jediIgnore Ignore
22-
hi def link jediFatSymbol Ignore
23-
hi def link jediSpace Normal
24-
25-
if exists('g:colors_name')
26-
hi def link jediFunction CursorLine
27-
hi def link jediFat TabLine
28-
else
29-
hi jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
30-
hi jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
31-
endif
32-
endif
5+
call jedi#setup_call_signatures()

autoload/jedi.vim

+31
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,37 @@ function! jedi#smart_auto_mappings()
531531
return "\<space>"
532532
endfunction
533533

534+
let s:prev_show_call_signatures = 0
535+
function! jedi#setup_call_signatures(...) abort
536+
if g:jedi#show_call_signatures > 0 && has('conceal')
537+
" +conceal is the default for vim >= 7.3
538+
539+
let s:e = g:jedi#call_signature_escape
540+
let s:full = s:e.'jedi=.\{-}'.s:e.'.\{-}'.s:e.'jedi'.s:e
541+
let s:ignore = s:e.'jedi.\{-}'.s:e
542+
exe 'syn match jediIgnore "'.s:ignore.'" contained conceal'
543+
setlocal conceallevel=2
544+
syn match jediFatSymbol "\*_\*" contained conceal
545+
syn match jediFat "\*_\*.\{-}\*_\*" contained contains=jediFatSymbol
546+
syn match jediSpace "\v[ ]+( )@=" contained
547+
exe 'syn match jediFunction "'.s:full.'" keepend extend '
548+
\ .' contains=jediIgnore,jediFat,jediSpace'
549+
\ .' containedin=pythonComment,pythonString,pythonRawString'
550+
unlet! s:e s:full s:ignore
551+
552+
hi def link jediIgnore Ignore
553+
hi def link jediFatSymbol Ignore
554+
hi def link jediSpace Normal
555+
556+
if exists('g:colors_name')
557+
hi def link jediFunction CursorLine
558+
hi def link jediFat TabLine
559+
else
560+
hi jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
561+
hi jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
562+
endif
563+
endif
564+
endfunction
534565

535566
"PythonJedi jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)
536567
"PythonJedi jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout)

0 commit comments

Comments
 (0)