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
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
end
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())
return ''
end
endif
if pumvisible() && !a:is_popup_on_dot
return "\<C-n>"
else
return "\<C-x>\<C-o>\<C-r>=jedi#complete_opened()\<CR>"
end
endif
endfunction
@@ -248,7 +248,7 @@ function! jedi#complete_opened()
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
return "\<Down>"
end
endif
return ""
endfunction
@@ -317,7 +317,7 @@ function! s:init()
if exists('g:jedi#'.key)
echom "'g:jedi#".key."' is deprecated. Please use 'g:jedi#".val."' instead. Sorry for the inconvenience."
exe 'let g:jedi#'.val.' = g:jedi#'.key
end
endif
endfor
for [key, val] in items(s:settings)
@@ -349,7 +349,7 @@ else
echomsg "Error: jedi-vim requires vim compiled with +python"
endif
finish
end
endif
"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
" close preview if its still open after insert
autocmd InsertLeave <buffer> if pumvisible() == 0|pclose|endif
end
end
endif
endif
if g:jedi#auto_vim_configuration
setlocal completeopt=menuone,longest,preview
if len(mapcheck('<C-c>', 'i')) == 0
inoremap <C-c> <ESC>
end
end
endif
endif

View File

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