Skip to content

Commit

Permalink
store b:changedtick after setting &filetype
Browse files Browse the repository at this point in the history
FileType autocmd handlers may modify the buffer, that is considered an
"internal change", not a "user change".

Don't set &filetype if we are not reloading the buffer.  It doesn't make
sense to trigger FileType autocmd handlers if we merely navigated to an
existing, loaded buffer.

ref #102
  • Loading branch information
justinmk committed Dec 12, 2017
1 parent 275320c commit 17ee209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/dirvish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ function! s:do_open(d, reload) abort
call s:win_init()
if a:reload || s:should_reload()
call s:buf_render(b:dirvish._dir, get(b:dirvish, 'lastpath', ''))
setlocal filetype=dirvish
let b:dirvish._c = b:changedtick
endif
setlocal filetype=dirvish
endfunction

function! s:should_reload() abort
Expand Down

0 comments on commit 17ee209

Please sign in to comment.