Improve on when to clear matches

This commit is contained in:
Marco Hinz 2013-10-23 21:19:35 +02:00
parent 48b7307e9e
commit a5cb421dae

View file

@ -36,7 +36,6 @@ let s:secoff = type(s:lists[0]) == 3 ? (len(s:lists[0]) + 1) : 0
let s:section_header_lines = [] let s:section_header_lines = []
" Init: autocmds {{{1 " Init: autocmds {{{1
if get(g:, 'startify_session_persistence') if get(g:, 'startify_session_persistence')
autocmd startify VimLeave * autocmd startify VimLeave *
\ if exists('v:this_session') && filewritable(v:this_session) | \ if exists('v:this_session') && filewritable(v:this_session) |
@ -134,6 +133,7 @@ function! startify#insane_in_the_membrane() abort
execute 'nnoremap <buffer><silent> '. g:startify_empty_buffer_key .' :enew<cr>' execute 'nnoremap <buffer><silent> '. g:startify_empty_buffer_key .' :enew<cr>'
endif endif
autocmd startify BufLeave <buffer> call clearmatches()
autocmd startify CursorMoved <buffer> call s:set_cursor() autocmd startify CursorMoved <buffer> call s:set_cursor()
if s:restore_position if s:restore_position
autocmd startify BufReadPost * call s:restore_position() autocmd startify BufReadPost * call s:restore_position()
@ -505,8 +505,6 @@ function! s:open_buffers(cword) abort
else else
execute 'normal' a:cword execute 'normal' a:cword
endif endif
call clearmatches()
endfunction endfunction
" Function: s:check_user_options {{{1 " Function: s:check_user_options {{{1