From bf96f7d611790a2ba88ba9a650ef3c645787368d Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 2 Apr 2015 16:16:17 +0200 Subject: [PATCH] jedi#auto_vim_configuration might not have been set before loading plugin. Therefore check if it was set. --- after/syntax/python.vim | 2 +- autoload/jedi.vim | 10 +++++----- ftplugin/python/jedi.vim | 8 ++++---- plugin/jedi.vim | 3 +-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/after/syntax/python.vim b/after/syntax/python.vim index 74ea072..9fda2ad 100644 --- a/after/syntax/python.vim +++ b/after/syntax/python.vim @@ -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 diff --git a/autoload/jedi.vim b/autoload/jedi.vim index ab79931..48776ce 100644 --- a/autoload/jedi.vim +++ b/autoload/jedi.vim @@ -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 "\" else return "\\\=jedi#complete_opened()\" - 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 "\" - 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) diff --git a/ftplugin/python/jedi.vim b/ftplugin/python/jedi.vim index b2f4104..c8d8f04 100644 --- a/ftplugin/python/jedi.vim +++ b/ftplugin/python/jedi.vim @@ -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 if pumvisible() == 0|pclose|endif - end -end + endif +endif if g:jedi#auto_vim_configuration setlocal completeopt=menuone,longest,preview if len(mapcheck('', 'i')) == 0 inoremap - end -end + endif +endif diff --git a/plugin/jedi.vim b/plugin/jedi.vim index 6d40db8..0b52c3a 100644 --- a/plugin/jedi.vim +++ b/plugin/jedi.vim @@ -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