vim-patch:7.4.1754

Problem:    When 'filetype' was set and reloading a buffer which does not
            cause it to be set, the syntax isn't loaded. (KillTheMule)
Solution:   Remember whether the FileType event was fired and fire it if not.
            (Anton Lindqvist, closes vim/vim#747)

c3691332f7
This commit is contained in:
James McCoy
2016-12-08 09:42:32 -05:00
parent 49d2952658
commit d1473880bc
3 changed files with 38 additions and 3 deletions

View File

@@ -61,3 +61,18 @@ func Test_syn_iskeyword()
quit!
endfunc
func Test_syntax_after_reload()
split Xsomefile
call setline(1, ['hello', 'there'])
w!
only!
setl filetype=hello
au FileType hello let g:gotit = 1
call assert_false(exists('g:gotit'))
edit other
buf Xsomefile
call assert_equal('hello', &filetype)
call assert_true(exists('g:gotit'))
call delete('Xsomefile')
endfunc