Implement cursor highlight feature

This commit is contained in:
haya14busa 2014-01-21 14:57:55 +09:00
parent fbcac3d37b
commit 16ec2a977e
3 changed files with 11 additions and 4 deletions

View File

@ -1309,6 +1309,11 @@ function! s:EasyMotion(regexp, direction, visualmode, is_inclusive, ...) " {{{
call EasyMotion#highlight#add_highlight(
\ shade_hl_re,
\ g:EasyMotion_hl_group_shade)
if g:EasyMotion_cursor_highlight
let cursor_hl_re = shade_hl_pos
call EasyMotion#highlight#add_highlight(cursor_hl_re,
\ g:EasyMotion_hl_inc_cursor)
endif
endif
endif
if hlcurrent != 0

View File

@ -39,6 +39,7 @@ let g:EasyMotion_enter_jump_first = get(g: , 'EasyMotion_enter_jump_first' ,
let g:EasyMotion_inc_highlight = get(g: , 'EasyMotion_inc_highlight' , 1)
let g:EasyMotion_move_highlight = get(g: , 'EasyMotion_move_highlight' , 1)
let g:EasyMotion_landing_highlight = get(g: , 'EasyMotion_landing_highlight' , 0)
let g:EasyMotion_cursor_highlight = get(g: , 'EasyMotion_cursor_highlight' , 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): ')
@ -102,9 +103,9 @@ let s:target_hl_inc = {
\ , 'cterm' : ['NONE', 'green' , 'bold']
\ }
let s:target_hl_inc_cursor = {
\ 'gui' : ['#d13a84', 'NONE' , 'bold']
\ , 'cterm256': ['magenta', 'NONE' , 'bold']
\ , 'cterm' : ['magenta', 'NONE' , 'bold']
\ 'gui' : ['#d13a84', '#f8f8f8' , 'bold']
\ , 'cterm256': ['magenta', 'white' , 'bold']
\ , 'cterm' : ['magenta', 'white' , 'bold']
\ }
let s:target_hl_move = {
\ 'gui' : ['#7fbf00', '#121813' , 'bold']

View File

@ -1,7 +1,7 @@
"=============================================================================
" FILE: t/easymotion_spec.vim
" AUTHOR: haya14busa
" Last Change: 21 Jan 2014.
" Last Change: 22 Jan 2014.
" Test: https://github.com/kana/vim-vspec
" Refer: https://github.com/rhysd/clever-f.vim
" Description: EasyMotion test with vim-vspec
@ -452,6 +452,7 @@ describe 'Default settings'
Expect g:EasyMotion_inc_highlight ==# 1
Expect g:EasyMotion_move_highlight ==# 1
Expect g:EasyMotion_landing_highlight ==# 0
Expect g:EasyMotion_cursor_highlight ==# 0
Expect g:EasyMotion_prompt ==# 'Search for {n} character(s): '
Expect g:EasyMotion_command_line_key_mappings ==# {}
" }}}