aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuangxiong Lin <[email protected]>2022-04-09 14:39:42 +0800
committerGuangxiong Lin <[email protected]>2022-04-09 14:39:42 +0800
commitccb9dac28217520be7d51bae9b7539ad07e86bab (patch)
treee95727698894462c0c336a27c8defba70c673122
parent2b1c9e7b4e7e93883aacc3762c70921500704519 (diff)
downloaddotfiles-ccb9dac28217520be7d51bae9b7539ad07e86bab.tar.gz
dotfiles-ccb9dac28217520be7d51bae9b7539ad07e86bab.tar.bz2
dotfiles-ccb9dac28217520be7d51bae9b7539ad07e86bab.zip
Use omnifunc only when it exists (vim)
-rw-r--r--.vim/after/plugin/mucomplete.vim6
1 files changed, 3 insertions, 3 deletions
diff --git a/.vim/after/plugin/mucomplete.vim b/.vim/after/plugin/mucomplete.vim
index cdfbe11..839ef12 100644
--- a/.vim/after/plugin/mucomplete.vim
+++ b/.vim/after/plugin/mucomplete.vim
@@ -4,14 +4,14 @@ let g:mucomplete#empty_text_auto = 1
let g:mucomplete#no_mappings = 1
let g:mucomplete#can_complete = {}
-let s:default_cond = { t -> t =~# '\%(\.\)$' }
+let s:default_cond = { t -> strlen(&omnifunc) > 0 && t =~# '\%(\.\)$' }
let g:mucomplete#can_complete.default = { 'omni': s:default_cond }
-let s:c_cond = { t -> t =~# '\%(\.\|->\)$' }
+let s:c_cond = { t -> strlen(&omnifunc) > 0 && t =~# '\%(\.\|->\)$' }
let g:mucomplete#can_complete.c = { 'omni': s:c_cond }
let g:mucomplete#can_complete.objc = { 'omni': s:c_cond }
-let s:cpp_cond = { t -> t =~# '\%(\.\|->\|::\)$' }
+let s:cpp_cond = { t -> strlen(&omnifunc) > 0 && t =~# '\%(\.\|->\|::\)$' }
let g:mucomplete#can_complete.cpp = { 'omni': s:cpp_cond }
let g:mucomplete#can_complete.objcpp = { 'omni': s:cpp_cond }
let g:mucomplete#can_complete.cuda = { 'omni': s:cpp_cond }