jedi#auto_vim_configuration might not have been set before loading plugin. Therefore check if it was set.

This commit is contained in:
Dave Halter
2015-04-02 16:16:17 +02:00
parent d3fadd54c7
commit bf96f7d611
4 changed files with 11 additions and 12 deletions

View File

@@ -24,5 +24,5 @@ if g:jedi#show_call_signatures > 0 && has('conceal')
else else
hi jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey hi jediFunction term=NONE cterm=NONE ctermfg=6 guifg=Black gui=NONE ctermbg=0 guibg=Grey
hi jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555 hi jediFat term=bold,underline cterm=bold,underline gui=bold,underline ctermbg=0 guibg=#555555
end endif
endif endif

View File

@@ -235,12 +235,12 @@ function! jedi#complete_string(is_popup_on_dot)
if a:is_popup_on_dot && !(g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight()) if a:is_popup_on_dot && !(g:jedi#popup_on_dot && jedi#do_popup_on_dot_in_highlight())
return '' return ''
end endif
if pumvisible() && !a:is_popup_on_dot if pumvisible() && !a:is_popup_on_dot
return "\<C-n>" return "\<C-n>"
else else
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened()\<CR>" return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened()\<CR>"
end endif
endfunction endfunction
@@ -248,7 +248,7 @@ function! jedi#complete_opened()
if pumvisible() && g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1 if pumvisible() && g:jedi#popup_select_first && stridx(&completeopt, 'longest') > -1
" only go down if it is visible, user-enabled and the longest option is set " only go down if it is visible, user-enabled and the longest option is set
return "\<Down>" return "\<Down>"
end endif
return "" return ""
endfunction endfunction
@@ -317,7 +317,7 @@ function! s:init()
if exists('g:jedi#'.key) if exists('g:jedi#'.key)
echom "'g:jedi#".key."' is deprecated. Please use 'g:jedi#".val."' instead. Sorry for the inconvenience." echom "'g:jedi#".key."' is deprecated. Please use 'g:jedi#".val."' instead. Sorry for the inconvenience."
exe 'let g:jedi#'.val.' = g:jedi#'.key exe 'let g:jedi#'.val.' = g:jedi#'.key
end endif
endfor endfor
for [key, val] in items(s:settings) for [key, val] in items(s:settings)
@@ -349,7 +349,7 @@ else
echomsg "Error: jedi-vim requires vim compiled with +python" echomsg "Error: jedi-vim requires vim compiled with +python"
endif endif
finish finish
end endif
"Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False) "Python jedi_vim.jedi.set_debug_function(jedi_vim.print_to_stdout, speed=True, warnings=False, notices=False)

View File

@@ -36,12 +36,12 @@ if g:jedi#auto_initialization
if g:jedi#auto_close_doc if g:jedi#auto_close_doc
" close preview if its still open after insert " close preview if its still open after insert
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
end endif
end endif
if g:jedi#auto_vim_configuration if g:jedi#auto_vim_configuration
setlocal completeopt=menuone,longest,preview setlocal completeopt=menuone,longest,preview
if len(mapcheck('<C-c>', 'i')) == 0 if len(mapcheck('<C-c>', 'i')) == 0
inoremap <C-c> <ESC> inoremap <C-c> <ESC>
end endif
end endif

View File

@@ -4,8 +4,7 @@
" This part of the software is just the vim interface. The really big deal is " This part of the software is just the vim interface. The really big deal is
" the Jedi Python library. " the Jedi Python library.
if !exists("g:jedi#auto_vim_configuration") || g:jedi#auto_vim_configuration
if g:jedi#auto_vim_configuration
" jedi-vim doesn't work in compatible mode (vim script syntax problems) " jedi-vim doesn't work in compatible mode (vim script syntax problems)
if &compatible if &compatible
set nocompatible set nocompatible