Merge branch 'feature/ascii-migemo'

This commit is contained in:
haya14busa 2017-04-27 12:16:27 +00:00
commit d55e7bf515
4 changed files with 291 additions and 165 deletions

View File

@ -561,19 +561,25 @@ function! s:convertRegep(input) "{{{
" 2. migemo " 2. migemo
" 3. smartsign " 3. smartsign
" 4. smartcase " 4. smartcase
let re = s:should_use_regexp() ? a:input : s:escape_regexp_char(a:input) let use_migemo = s:should_use_migemo(a:input)
let re = use_migemo || s:should_use_regexp() ? a:input : s:escape_regexp_char(a:input)
" Convert space to match only start of spaces " Convert space to match only start of spaces
if re ==# ' ' if re ==# ' '
let re = '\s\+' let re = '\s\+'
endif endif
if s:should_use_migemo(a:input) if use_migemo
let re = s:convertMigemo(re) let re = s:convertMigemo(re)
endif endif
if s:should_use_smartsign(a:input) if s:should_use_smartsign(a:input)
let re = s:convertSmartsign(a:input) let r = s:convertSmartsign(a:input)
if use_migemo
let re = re . '\m\|' . r
else
let re = r
endif
endif endif
let case_flag = EasyMotion#helper#should_case_sensitive( let case_flag = EasyMotion#helper#should_case_sensitive(
@ -593,10 +599,7 @@ function! s:convertMigemo(re) "{{{
if ! has_key(s:migemo_dicts, &l:encoding) if ! has_key(s:migemo_dicts, &l:encoding)
let s:migemo_dicts[&l:encoding] = EasyMotion#helper#load_migemo_dict() let s:migemo_dicts[&l:encoding] = EasyMotion#helper#load_migemo_dict()
endif endif
if re =~# '^\a$' return get(s:migemo_dicts[&l:encoding], re, a:re)
let re = get(s:migemo_dicts[&l:encoding], re, a:re)
endif
return re
endfunction "}}} endfunction "}}}
function! s:convertSmartsign(chars) "{{{ function! s:convertSmartsign(chars) "{{{
" Convert given chars to smartsign string " Convert given chars to smartsign string
@ -641,7 +644,7 @@ function! s:should_use_regexp() "{{{
return g:EasyMotion_use_regexp == 1 && s:flag.regexp == 1 return g:EasyMotion_use_regexp == 1 && s:flag.regexp == 1
endfunction "}}} endfunction "}}}
function! s:should_use_migemo(char) "{{{ function! s:should_use_migemo(char) "{{{
if ! g:EasyMotion_use_migemo || match(a:char, '\A') != -1 if ! g:EasyMotion_use_migemo || match(a:char, '[^!-~]') != -1
return 0 return 0
endif endif

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long