From 17dd1647677f6286e22ae13f3a3323eb8b8470f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E4=BA=91?= <lilydjwg@gmail.com> Date: Mon, 13 May 2013 12:30:02 +0800 Subject: [PATCH] neocomplcache: remove text mode --- autoload/neocomplcache/complete.vim | 5 +---- autoload/neocomplcache/filters/converter_case.vim | 4 ---- autoload/neocomplcache/init.vim | 8 -------- autoload/neocomplcache/mappings.vim | 4 +--- autoload/neocomplcache/sources/dictionary_complete.vim | 10 ++-------- 5 files changed, 4 insertions(+), 27 deletions(-) diff --git a/autoload/neocomplcache/complete.vim b/autoload/neocomplcache/complete.vim index 0012e2e3..a7f2c150 100644 --- a/autoload/neocomplcache/complete.vim +++ b/autoload/neocomplcache/complete.vim @@ -240,7 +240,6 @@ function! neocomplcache#complete#_get_words(sources, complete_pos, complete_str) " Check dup and set icase. let icase = g:neocomplcache_enable_ignore_case && \!(g:neocomplcache_enable_smart_case && a:complete_str =~ '\u') - \ && !neocomplcache#is_text_mode() for candidate in candidates if has_key(candidate, 'kind') && candidate.kind == '' " Remove kind key. @@ -340,9 +339,7 @@ function! neocomplcache#complete#_set_results_words(sources) "{{{ let context = source.neocomplcache__context - if neocomplcache#is_text_mode() - let &ignorecase = 1 - elseif g:neocomplcache_enable_smart_case + if g:neocomplcache_enable_smart_case \ && context.complete_str =~ '\u' let &ignorecase = 0 else diff --git a/autoload/neocomplcache/filters/converter_case.vim b/autoload/neocomplcache/filters/converter_case.vim index 0d651d84..a0e87360 100644 --- a/autoload/neocomplcache/filters/converter_case.vim +++ b/autoload/neocomplcache/filters/converter_case.vim @@ -37,10 +37,6 @@ let s:converter = { \} function! s:converter.filter(context) "{{{ - if neocomplcache#is_text_mode() - return a:context.candidates - endif - let convert_candidates = filter(copy(a:context.candidates), \ "get(v:val, 'neocomplcache__convertable', 1) \ && v:val.word =~ '^\\u\\+$\\|^\\u\\?\\l\\+$'") diff --git a/autoload/neocomplcache/init.vim b/autoload/neocomplcache/init.vim index 3cb597e6..62b4c12b 100644 --- a/autoload/neocomplcache/init.vim +++ b/autoload/neocomplcache/init.vim @@ -585,14 +585,6 @@ function! neocomplcache#init#_variables() "{{{ \ '__attribute_pure__,__attribute_warn_unused_result__,__attribute__+') "}}} - " Initialize text mode filetypes. "{{{ - call neocomplcache#util#set_default( - \ 'g:neocomplcache_text_mode_filetypes', {}) - call neocomplcache#util#set_default_dictionary( - \ 'g:neocomplcache_text_mode_filetypes', - \ 'text,help,tex,gitcommit,vcs-commit', 1) - "}}} - " Initialize tags filter patterns. "{{{ call neocomplcache#util#set_default( \ 'g:neocomplcache_tags_filter_patterns', {}) diff --git a/autoload/neocomplcache/mappings.vim b/autoload/neocomplcache/mappings.vim index 94d8f5c3..e572c745 100644 --- a/autoload/neocomplcache/mappings.vim +++ b/autoload/neocomplcache/mappings.vim @@ -101,9 +101,7 @@ function! neocomplcache#mappings#complete_common_string() "{{{ let [complete_pos, complete_str] = \ neocomplcache#match_word(neocomplcache#get_cur_text(1)) - if neocomplcache#is_text_mode() - let &ignorecase = 1 - elseif g:neocomplcache_enable_smart_case && complete_str =~ '\u' + if g:neocomplcache_enable_smart_case && complete_str =~ '\u' let &ignorecase = 0 else let &ignorecase = g:neocomplcache_enable_ignore_case diff --git a/autoload/neocomplcache/sources/dictionary_complete.vim b/autoload/neocomplcache/sources/dictionary_complete.vim index 6c542f1d..c7dc7d60 100644 --- a/autoload/neocomplcache/sources/dictionary_complete.vim +++ b/autoload/neocomplcache/sources/dictionary_complete.vim @@ -79,12 +79,7 @@ endfunction"}}} function! s:source.get_keyword_list(complete_str) "{{{ let list = [] - let filetype = neocomplcache#is_text_mode() ? - \ 'text' : neocomplcache#get_context_filetype() - if !has_key(s:dictionary_list, filetype) - " Caching. - call s:caching() - endif + let filetype = neocomplcache#get_context_filetype() for ft in neocomplcache#get_source_filetypes(filetype) call neocomplcache#cache#check_cache('dictionary_cache', ft, @@ -103,8 +98,7 @@ function! s:caching() "{{{ return endif - let key = neocomplcache#is_text_mode() ? - \ 'text' : neocomplcache#get_context_filetype() + let key = neocomplcache#get_context_filetype() for filetype in neocomplcache#get_source_filetypes(key) if !has_key(s:dictionary_list, filetype) \ && !has_key(s:async_dictionary_list, filetype) -- 2.48.1