haya14busa / incsearch-easymotion.vim

101 stars 2 forks source link

After searching backward, the n-direction is wrong #2

Open toshi32tony3 opened 8 years ago

toshi32tony3 commented 8 years ago

backward検索後、n/Nのカーソル移動方向がforward検索時と同じになっています。

haya14busa commented 8 years ago

以下のようなマッピングをしてないでしょうか?

let g:incsearch#consistent_n_direction = 1

デフォルト状態だと再現しないように思います

toshi32tony3 commented 8 years ago

コメントありがとうございます。consistent_n_directionは使用していません。 再確認したのですが、現象が再現しています。少しコードを確認してみます。

set encoding=utf-8
scriptencoding utf-8

filetype plugin indent off

if has('vim_starting')
  set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

call neobundle#begin(expand('~/.vim/bundle'))

NeoBundle 'haya14busa/incsearch.vim'
NeoBundle 'easymotion/vim-easymotion'
NeoBundle 'haya14busa/incsearch-easymotion.vim',

call neobundle#end()

filetype plugin indent on
syntax enable

map z/ <Plug>(incsearch-easymotion-/)
map z? <Plug>(incsearch-easymotion-?)
map gz/ <Plug>(incsearch-easymotion-stay)
noremap <silent> <expr> gz? incsearch#go(incsearch#config#easymotion#make({'command' : '?', 'is_stay' : 1}))
toshi32tony3 commented 8 years ago

コード読んだのですが、原因まで辿りつけていません…。 以下コメントアウトしても再現するのでeasymotion自体は関係ないみたいです。

incsearch-easymotion.vim\autoload\incsearch\over\modules\EasyMotion.vim

function! s:module.on_char_pre(cmdline) if a:cmdline.is_input('(easymotion)') " echo a:cmdline.setchar('') " echo self._easymotion(a:cmdline) echo a:cmdline._exit_incsearch() endif endfunction

それと、easymotionでは以下の関数が呼び出されていませんでした。 (通常のincsearch, incsearch-fuzzy, incsearch-migemoでは呼び出されていました)

incsearch.vim\autoload\incsearch.vim

function! s:_searchforward_cmd() abort let d = (g:incsearch#consistent_n_direction ? s:DIRECTION.forward : (incsearch#cli()._base_key is# '/' ? 1 : 0)) return printf(":let v:searchforward=%d", d) endfunction