Merge branch 'add/disable_two_key_combo' into master

This commit is contained in:
haya14busa 2014-02-18 17:53:36 +09:00
commit fc13fad075
4 changed files with 24 additions and 7 deletions

View File

@ -887,7 +887,9 @@ function! s:PromptUser(groups) "{{{
if strlen(lines[line_num]['marker']) > 0
" Substitute marker character if line length > 0
let c = 0
while c < target_key_len && c < 2
let marker_max_length = g:EasyMotion_disable_two_key_combo == 1
\ ? 1 : 2
while c < target_key_len && c < marker_max_length
if strlen(lines[line_num]['marker']) >= col_num + c
" Substitute marker character if line length > 0
if c == 0
@ -922,9 +924,11 @@ function! s:PromptUser(groups) "{{{
call EasyMotion#highlight#add_highlight(
\ '\%' . line_num . 'l\%' . col_num . 'c',
\ g:EasyMotion_hl2_first_group_target)
call EasyMotion#highlight#add_highlight(
\ '\%' . line_num . 'l\%' . (col_num + 1) . 'c',
\ g:EasyMotion_hl2_second_group_target)
if g:EasyMotion_disable_two_key_combo == 1
call EasyMotion#highlight#add_highlight(
\ '\%' . line_num . 'l\%' . (col_num + 1) . 'c',
\ g:EasyMotion_hl2_second_group_target)
endif
endif
"}}}

View File

@ -30,7 +30,9 @@ CONTENTS *easymotion-contents*
EasyMotion_enter_jump_first ..... |EasyMotion_enter_jump_first|
EasyMotion_prompt ............... |EasyMotion_prompt|
EasyMotion_highlight ............ |EasyMotion_highlight|
EasyMotion_add_search_history.... |EasyMotion_add_search_history|
EasyMotion_add_search_history ... |EasyMotion_add_search_history|
EasyMotion_off_screen_search .... |EasyMotion_off_screen_search|
EasyMotion_disable_two_key_combo. |EasyMotion_disable_two_key_combo|
Custom highlighting ............. |easymotion-custom-hl|
Custom mappings ................. |easymotion-custom-mappings|
Leader key .................. |easymotion-leader-key|
@ -938,6 +940,14 @@ EasyMotion_off_screen_search *g:EasyMotion_off_screen_search*
<
Default: 0
EasyMotion_disable_two_key_combo *g:EasyMotion_disable_two_key_combo*
If you set this option to 1, you can disable two key combo feature.
>
let g:EasyMotion_disable_two_key_combo = 1
<
Default: 0
------------------------------------------------------------------------------
Custom highlighting *easymotion-custom-hl*

View File

@ -3,7 +3,7 @@
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
" haya14busa <hayabusa1419@gmail.com>
" Source: https://github.com/Lokaltog/vim-easymotion
" Last Change: 13 Feb 2014.
" Last Change: 18 Feb 2014.
" == Script initialization {{{
if expand("%:p") ==# expand("<sfile>:p")
unlet! g:EasyMotion_loaded
@ -42,12 +42,14 @@ let g:EasyMotion_cursor_highlight = get(g: , 'EasyMotion_cursor_highlight' ,
let g:EasyMotion_use_regexp = get(g: , 'EasyMotion_use_regexp' , 1)
let g:EasyMotion_add_search_history = get(g: , 'EasyMotion_add_search_history' , 1)
let g:EasyMotion_off_screen_search = get(g: , 'EasyMotion_off_screen_search' , 1)
let g:EasyMotion_force_csapprox = get(g: , 'EasyMotion_force_csapprox' , 0)
let g:EasyMotion_force_csapprox = get(g: , 'EasyMotion_force_csapprox' , 0)
let g:EasyMotion_show_prompt = get(g: , 'EasyMotion_show_prompt' , 1)
let g:EasyMotion_prompt =
\ get(g: , 'EasyMotion_prompt' , 'Search for {n} character(s): ')
let g:EasyMotion_command_line_key_mappings =
\ get(g: , 'EasyMotion_command_line_key_mappings' , {})
let g:EasyMotion_disable_two_key_combo =
\ get(g: , 'EasyMotion_disable_two_key_combo' , 0)
"}}}

View File

@ -487,6 +487,7 @@ describe 'Default settings'
Expect g:EasyMotion_prompt ==# 'Search for {n} character(s): '
Expect g:EasyMotion_command_line_key_mappings ==# {}
Expect g:EasyMotion_force_csapprox ==# 0
Expect g:EasyMotion_disable_two_key_combo ==# 0
" }}}
" highlight {{{