Skip to content

Commit

Permalink
vimrc: don't search when pattern is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
yous committed Nov 6, 2019
1 parent fe32bfa commit 1ed317e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,9 @@ if has_key(g:plugs, 'vim-searchindex')
nmap <silent> g# g#zz<Plug>SearchIndex
else
function! s:CenterBeforeSearch(opposite)
if @/ ==# ''
return
endif
let backward = v:searchforward == a:opposite
let flags = backward ? 'b' : ''
for i in range(v:count1 - 1)
Expand Down

0 comments on commit 1ed317e

Please sign in to comment.