mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
vim-patch:9.1.0558: filetype: prolog detection can be improved
Problem: filetype: prolog detection can be improved
Solution: Improved the Prolog file detection regex and added tests for
all cases. (igna_martinoli)
fixes: vim/vim#10835
closes: vim/vim#15206
50dc83cf92
Only include the tests, as code changes are superseded by later patches.
Co-authored-by: igna_martinoli <ignamartinoli@protonmail.com>
This commit is contained in:
@@ -2576,4 +2576,31 @@ func Test_uci_file()
|
|||||||
filetype off
|
filetype off
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_pro_file()
|
||||||
|
filetype on
|
||||||
|
|
||||||
|
"Prolog
|
||||||
|
call writefile([':-module(test/1,'], 'Xfile.pro', 'D')
|
||||||
|
split Xfile.pro
|
||||||
|
call assert_equal('prolog', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['% comment'], 'Xfile.pro', 'D')
|
||||||
|
split Xfile.pro
|
||||||
|
call assert_equal('prolog', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['/* multiline comment'], 'Xfile.pro', 'D')
|
||||||
|
split Xfile.pro
|
||||||
|
call assert_equal('prolog', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
call writefile(['rule(test, 1.7).'], 'Xfile.pro', 'D')
|
||||||
|
split Xfile.pro
|
||||||
|
call assert_equal('prolog', &filetype)
|
||||||
|
bwipe!
|
||||||
|
|
||||||
|
filetype off
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
Reference in New Issue
Block a user