aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-11 06:48:17 +0800
committerGitHub <noreply@github.com>2025-03-11 06:48:17 +0800
commit0ef1147313caa47c87c7baa79043ddcff55ef5e1 (patch)
treea6dba157e101e0e63327d20ae431e43c6a88f885 /test
parentf2c0755828d529af101b5d0e4a1fd204fd0a7039 (diff)
parent4533c40786a68d57b878babd46ea70e761392cf0 (diff)
downloadrneovim-0ef1147313caa47c87c7baa79043ddcff55ef5e1.tar.gz
rneovim-0ef1147313caa47c87c7baa79043ddcff55ef5e1.tar.bz2
rneovim-0ef1147313caa47c87c7baa79043ddcff55ef5e1.zip
Merge pull request #32828 from zeertzjq/vim-9.1.1186
vim-patch:9.1.{1186,1191,1194}: filetype: help files in git repos are not detected
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_filetype.vim32
1 files changed, 30 insertions, 2 deletions
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index 296062f92c..633166c5ce 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -916,8 +916,6 @@ func s:GetFilenameChecks() abort
\ '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zsh_history',
\ '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file',
\ 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'],
- \
- \ 'help': [$VIMRUNTIME .. '/doc/help.txt'],
\ }
endfunc
@@ -1620,6 +1618,36 @@ func Test_haredoc_file()
filetype off
endfunc
+func Test_help_file()
+ set nomodeline
+ filetype on
+ call assert_true(mkdir('doc', 'pR'))
+
+ call writefile(['some text', 'vim:ft=help:'], 'doc/help.txt', 'D')
+ split doc/help.txt
+ call assert_equal('help', &filetype)
+ bwipe!
+
+ call writefile(['some text', 'Copyright: |manual-copyright| vim:ft=help:'],
+ \ 'doc/help1.txt', 'D')
+ split doc/help1.txt
+ call assert_equal('help', &filetype)
+ bwipe!
+
+ call writefile(['some text'], 'doc/nothelp.txt', 'D')
+ split doc/nothelp.txt
+ call assert_notequal('help', &filetype)
+ bwipe!
+
+ call writefile(['some text', '`vim:ft=help`'], 'doc/nothelp1.txt', 'D')
+ split doc/nothelp1.txt
+ call assert_notequal('help', &filetype)
+ bwipe!
+
+ filetype off
+ set modeline&
+endfunc
+
func Test_hook_file()
filetype on