Skip to content

Commit

Permalink
fix: also disable related mapping when autonohl is off
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyyip committed Jul 22, 2023
1 parent 2060a96 commit c735e59
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions plugin/is.vim
Expand Up @@ -57,17 +57,19 @@ if get(g:, 'is#do_default_mappings', 1)
if mapcheck("\<C-k>", 'c') ==# ''
cmap <C-k> <Plug>(is-scroll-b)
endif
for s:map in ['n', 'N', '*', '#', 'g*', 'g#']
if mapcheck(s:map, 'n') ==# ''
execute printf(':nmap %s <Plug>(is-%s)', s:map, s:map)
endif
if mapcheck(s:map, 'x') ==# ''
execute printf(':xmap %s <Plug>(is-%s)', s:map, s:map)
endif
if mapcheck(s:map, 'o') ==# ''
execute printf(':omap %s <Plug>(is-%s)', s:map, s:map)
endif
endfor
if get(g:, 'is#auto_nohlsearch', 1)
for s:map in ['n', 'N', '*', '#', 'g*', 'g#']
if mapcheck(s:map, 'n') ==# ''
execute printf(':nmap %s <Plug>(is-%s)', s:map, s:map)
endif
if mapcheck(s:map, 'x') ==# ''
execute printf(':xmap %s <Plug>(is-%s)', s:map, s:map)
endif
if mapcheck(s:map, 'o') ==# ''
execute printf(':omap %s <Plug>(is-%s)', s:map, s:map)
endif
endfor
endif
unlet s:map
endif

Expand Down

0 comments on commit c735e59

Please sign in to comment.