aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-08 09:42:32 -0500
committerJames McCoy <jamessan@jamessan.com>2016-12-08 10:27:32 -0500
commitd1473880bcd6fdd8cc72b5595903081e59c6d2d1 (patch)
treeede18f1190213c10e35636e0d41ede1125513624 /src/nvim/testdir
parent49d29526587b587d08e2883b060c756637e891a2 (diff)
downloadrneovim-d1473880bcd6fdd8cc72b5595903081e59c6d2d1.tar.gz
rneovim-d1473880bcd6fdd8cc72b5595903081e59c6d2d1.tar.bz2
rneovim-d1473880bcd6fdd8cc72b5595903081e59c6d2d1.zip
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
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_syntax.vim15
1 files changed, 15 insertions, 0 deletions
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