From d1473880bcd6fdd8cc72b5595903081e59c6d2d1 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Thu, 8 Dec 2016 09:42:32 -0500 Subject: 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) https://github.com/vim/vim/commit/c3691332f72169c486066200c0f3935418364900 --- src/nvim/testdir/test_syntax.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim index 309c0f460b..af2cbbfe8e 100644 --- a/src/nvim/testdir/test_syntax.vim +++ b/src/nvim/testdir/test_syntax.vim @@ -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 -- cgit