Skip to content

Commit d55e7bf

Browse files
committed
Merge branch 'feature/ascii-migemo'
2 parents f916d60 + 1ca831d commit d55e7bf

File tree

4 files changed

+291
-165
lines changed

4 files changed

+291
-165
lines changed

autoload/EasyMotion.vim

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -561,19 +561,25 @@ function! s:convertRegep(input) "{{{
561561
" 2. migemo
562562
" 3. smartsign
563563
" 4. smartcase
564-
let re = s:should_use_regexp() ? a:input : s:escape_regexp_char(a:input)
564+
let use_migemo = s:should_use_migemo(a:input)
565+
let re = use_migemo || s:should_use_regexp() ? a:input : s:escape_regexp_char(a:input)
565566

566567
" Convert space to match only start of spaces
567568
if re ==# ' '
568569
let re = '\s\+'
569570
endif
570571

571-
if s:should_use_migemo(a:input)
572+
if use_migemo
572573
let re = s:convertMigemo(re)
573574
endif
574575

575576
if s:should_use_smartsign(a:input)
576-
let re = s:convertSmartsign(a:input)
577+
let r = s:convertSmartsign(a:input)
578+
if use_migemo
579+
let re = re . '\m\|' . r
580+
else
581+
let re = r
582+
endif
577583
endif
578584

579585
let case_flag = EasyMotion#helper#should_case_sensitive(
@@ -593,10 +599,7 @@ function! s:convertMigemo(re) "{{{
593599
if ! has_key(s:migemo_dicts, &l:encoding)
594600
let s:migemo_dicts[&l:encoding] = EasyMotion#helper#load_migemo_dict()
595601
endif
596-
if re =~# '^\a$'
597-
let re = get(s:migemo_dicts[&l:encoding], re, a:re)
598-
endif
599-
return re
602+
return get(s:migemo_dicts[&l:encoding], re, a:re)
600603
endfunction "}}}
601604
function! s:convertSmartsign(chars) "{{{
602605
" Convert given chars to smartsign string
@@ -641,7 +644,7 @@ function! s:should_use_regexp() "{{{
641644
return g:EasyMotion_use_regexp == 1 && s:flag.regexp == 1
642645
endfunction "}}}
643646
function! s:should_use_migemo(char) "{{{
644-
if ! g:EasyMotion_use_migemo || match(a:char, '\A') != -1
647+
if ! g:EasyMotion_use_migemo || match(a:char, '[^!-~]') != -1
645648
return 0
646649
endif
647650

0 commit comments

Comments
 (0)