haya14busa / incsearch-fuzzy.vim

130 stars 3 forks source link

Bug: backward fuzzy match results don't show in highlight #5

Closed daidodo closed 7 years ago

daidodo commented 7 years ago

Description

Hi, incsearch-fuzzy is really a great tool and I'm trying to use it as a default search mechanism. But when I'm doing fuzzy matching backward, sometimes the results don't show in highlight.

Environment

Ubuntu Linux ubuntu 4.4.27-moby #1 SMP Wed Oct 26 14:21:29 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Vim 7.4

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version without GUI.  Features included (+) or not (-):
+acl             +cmdline_compl   +digraphs        +folding         +libcall         +mouse_dec       +netbeans_intg   +reltime         +tag_old_static  +virtualedit     -xim
+arabic          +cmdline_hist    -dnd             -footer          +linebreak       +mouse_gpm       +packages        +rightleft       -tag_any_white   +visual          -xsmp
+autocmd         +cmdline_info    -ebcdic          +fork()          +lispindent      -mouse_jsbterm   +path_extra      -ruby            -tcl             +visualextra     -xterm_clipboard
-balloon_eval    +comments        +emacs_tags      +gettext         +listcmds        +mouse_netterm   -perl            +scrollbind      +terminfo        +viminfo         -xterm_save
-browse          +conceal         +eval            -hangul_input    +localmap        +mouse_sgr       +persistent_undo +signs           +termresponse    +vreplace        -xpm
++builtin_terms  +cryptv          +ex_extra        +iconv           -lua             -mouse_sysmouse  +postscript      +smartindent     +textobjects     +wildignore
+byte_offset     +cscope          +extra_search    +insert_expand   +menu            +mouse_urxvt     +printer         +startuptime     +timers          +wildmenu
+channel         +cursorbind      +farsi           +job             +mksession       +mouse_xterm     +profile         +statusline      +title           +windows
+cindent         +cursorshape     +file_in_path    +jumplist        +modify_fname    +multi_byte      -python          -sun_workshop    -toolbar         +writebackup
-clientserver    +dialog_con      +find_in_path    +keymap          +mouse           +multi_lang      +python3         +syntax          +user_commands   -X11
-clipboard       +diff            +float           +langmap         -mouseshape      -mzscheme        +quickfix        +tag_binary      +vertsplit       -xfontset
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl     -L/usr/lib/python3.5/co
nfig-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm

.vimrc

" ----Begin Vundle---
filetype off   " Disable file type detection, required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'easymotion/vim-easymotion'
Plugin 'haya14busa/incsearch.vim'
Plugin 'haya14busa/incsearch-fuzzy.vim'
Plugin 'haya14busa/incsearch-easymotion.vim'

call vundle#end() " required
filetype plugin indent on

noremap <silent><expr> /  incsearch#go(<SID>config_easyfuzzymotion())
noremap <silent><expr> ?  incsearch#go(<SID>config_easyfuzzymotion({'command': '?'}))
function! s:incsearch_config(...) abort
  return extend(copy({
  \   'modules': [incsearch#config#easymotion#module({'overwin': 1})],
  \   'keymap': {"\<CR>": '<Over>(easymotion)'},
  \   'is_expr': 0
  \ }), get(a:, 1, {}))
endfunction
function! s:config_easyfuzzymotion(...) abort
  return s:incsearch_config(extend(copy({
  \   'converters': [incsearch#config#fuzzyword#converter()],
  \ }), get(a:, 1, {})))
endfunction

example.txt

/// Lock-free and process/thread-safe hash table implementation.
///

/** A lock-free hash table that can be used in multi-thread or multi-process programs.
 *  A common usage of CAtomicHashTable is for multiple threads or processes to operate on the same

Repreduce

As comparison, you can try searching forward by typing /sss, and the two match results are highlighted as expected.

Addition

After I added {'is_stay': 1} to config_easyfuzzymotion(), the highlight gets back to expectation:

noremap <silent><expr> ?  incsearch#go(<SID>config_easyfuzzymotion({'command': '?', 'is_stay': 1}))

But that's still different from what ? really does.

haya14busa commented 7 years ago

Thank you for the detail report! :+1: :+1: :+1: I fixed it with 1a63f02

Please update the plugin.

daidodo commented 7 years ago

Thanks for your great work!