Skip to content

Commit af898d9

Browse files
clasonFreed-Wu
andcommitted
vim-patch:9.1.0245: filetype: zsh theme, history and zunit files are not recognized
Problem: filetype: zsh theme, history and zunit files are not recognized. Solution: Detect '.zsh_history', '*.zsh-theme' and '*.zunit' as zsh (Wu, Zhenyu) closes: vim/vim#14366 vim/vim@a55a22a Co-authored-by: Wu, Zhenyu <[email protected]>
1 parent 053a2c5 commit af898d9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

runtime/lua/vim/filetype.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,8 @@ local extension = {
11551155
zut = 'zimbutempl',
11561156
zs = 'zserio',
11571157
zsh = 'zsh',
1158+
zunit = 'zsh',
1159+
['zsh-theme'] = 'zsh',
11581160
vala = 'vala',
11591161
web = detect.web,
11601162
pl = detect.pl,
@@ -2049,6 +2051,7 @@ local pattern = {
20492051
['XF86Config%-4.*'] = starsetf(detect.xfree86_v4, { priority = -math.huge + 1 }),
20502052
['XF86Config.*'] = starsetf(detect.xfree86_v3),
20512053
['%.zcompdump.*'] = starsetf('zsh'),
2054+
['%.zsh_history'] = starsetf('zsh'),
20522055
-- .zlog* and zlog*
20532056
['%.?zlog.*'] = starsetf('zsh'),
20542057
-- .zsh* and zsh*

test/old/testdir/test_filetype.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,7 @@ func s:GetFilenameChecks() abort
750750
\ 'zimbu': ['file.zu'],
751751
\ 'zimbutempl': ['file.zut'],
752752
\ 'zserio': ['file.zs'],
753-
\ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'],
754-
\
753+
\ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', 'file.zsh-theme', 'file.zunit', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zsh_history', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'],
755754
\ 'help': [$VIMRUNTIME . '/doc/help.txt'],
756755
\ }
757756
endfunc

0 commit comments

Comments
 (0)