diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2017-02-13 15:36:59 +0900 |
---|---|---|
committer | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2017-02-13 15:36:59 +0900 |
commit | 5537b3bcda3da7ea2b26acab1013a9c4e78cabeb (patch) | |
tree | 822374236d4335c599edbcb41fd71040f07c38c4 /rplugin/python3 | |
parent | 2e9fd874b7d974a03df8af10a090e2601b16c7f0 (diff) | |
download | deoplete.nvim-5537b3bcda3da7ea2b26acab1013a9c4e78cabeb.zip |
Fix #431 omni source filetype problem
Diffstat (limited to 'rplugin/python3')
-rw-r--r-- | rplugin/python3/deoplete/source/omni.py | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/rplugin/python3/deoplete/source/omni.py b/rplugin/python3/deoplete/source/omni.py index 2eceb83..c5ae5c3 100644 --- a/rplugin/python3/deoplete/source/omni.py +++ b/rplugin/python3/deoplete/source/omni.py @@ -40,52 +40,52 @@ class Source(Base): return self.__prev_pos current_ft = self.vim.eval('&filetype') - for filetype in context['filetypes']: - for omnifunc in convert2list( - get_buffer_config(context, filetype, - 'deoplete_omni_functions', - 'deoplete#omni#functions', - {'_': ''})): - if omnifunc == '' and (filetype == current_ft or - filetype in ['css', 'javascript']): - omnifunc = context['omni__omnifunc'] - if omnifunc == '' or not self.vim.call( - 'deoplete#util#exists_omnifunc', omnifunc): - continue - self.__omnifunc = omnifunc - for input_pattern in convert2list( + filetype = context['filetype'] + for omnifunc in convert2list( + get_buffer_config(context, filetype, + 'deoplete_omni_functions', + 'deoplete#omni#functions', + {'_': ''})): + if omnifunc == '' and (filetype == current_ft or + filetype in ['css', 'javascript']): + omnifunc = context['omni__omnifunc'] + if omnifunc == '' or not self.vim.call( + 'deoplete#util#exists_omnifunc', omnifunc): + continue + self.__omnifunc = omnifunc + for input_pattern in convert2list( get_buffer_config(context, filetype, 'deoplete_omni_input_patterns', 'deoplete#omni#input_patterns', self.__input_patterns)): - m = re.search('(' + input_pattern + ')$', context['input']) - # self.debug(filetype) - # self.debug(input_pattern) - if input_pattern == '' or (context['event'] != - 'Manual' and m is None): - continue - - if filetype == current_ft and self.__omnifunc in [ - 'ccomplete#Complete', - 'htmlcomplete#CompleteTags', - 'phpcomplete#CompletePHP']: - # In the blacklist - error(self.vim, - 'omni source does not support: ' + + m = re.search('(' + input_pattern + ')$', context['input']) + # self.debug(filetype) + # self.debug(input_pattern) + if input_pattern == '' or (context['event'] != + 'Manual' and m is None): + continue + + if filetype == current_ft and self.__omnifunc in [ + 'ccomplete#Complete', + 'htmlcomplete#CompleteTags', + 'phpcomplete#CompletePHP']: + # In the blacklist + error(self.vim, + 'omni source does not support: ' + + self.__omnifunc) + error(self.vim, + 'You must use g:deoplete#omni_patterns' + + ' instead.') + return -1 + try: + complete_pos = self.vim.call(self.__omnifunc, 1, '') + except: + error_vim(self.vim, + 'Error occurred calling omnifunction: ' + self.__omnifunc) - error(self.vim, - 'You must use g:deoplete#omni_patterns' + - ' instead.') - return -1 - try: - complete_pos = self.vim.call(self.__omnifunc, 1, '') - except: - error_vim(self.vim, - 'Error occurred calling omnifunction: ' + - self.__omnifunc) - return -1 - return complete_pos + return -1 + return complete_pos return -1 def gather_candidates(self, context): |