patch 9.1.1212: filetype: logrotate'd pacmanlogs are not recognized
Commit:
https://github.com/vim/vim/commit/20d23ce93b84ea199d5ea56d7ec86f5e6846d6cc
Author: Eisuke Kawashima <[email protected]>
Date: Sun Mar 16 20:37:14 2025 +0100
patch 9.1.1212: filetype: logrotate'd pacmanlogs are not recognized
Problem: filetype: logrotate'd pacmanlogs are not recognized
Solution: also detect pacman.log* files as pacmanlog filetype,
remove BufNewFile autocmd (Eisuke Kawashima)
closes: #16873
Signed-off-by: Eisuke Kawashima <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 44dec008f..22324df8b 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1814,7 +1814,7 @@ au BufNewFile,BufRead *.hook
au BufNewFile,BufRead {.,}makepkg.conf setf sh
" Pacman log
-au BufNewFile,BufRead pacman.log setf pacmanlog
+au BufRead pacman.log* call
s:StarSetf('pacmanlog')
" Pam conf
au BufNewFile,BufRead */etc/pam.conf setf pamconf
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 02cab62a4..fe26d9256 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -574,7 +574,6 @@ def s:GetFilenameChecks(): dict<list<string>>
opl: ['file.OPL', 'file.OPl', 'file.OpL', 'file.Opl', 'file.oPL',
'file.oPl', 'file.opL', 'file.opl'],
ora: ['file.ora'],
org: ['file.org', 'file.org_archive'],
- pacmanlog: ['pacman.log'],
pamconf: ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf',
'any/etc/pam.d/file'],
pamenv: ['/etc/security/pam_env.conf', '/home/user/.pam_environment',
'.pam_environment', 'pam_env.conf'],
pandoc: ['file.pandoc', 'file.pdk', 'file.pd', 'file.pdc'],
@@ -2877,4 +2876,16 @@ func Test_org_file()
filetype off
endfunc
+" Filetypes detected from names of existing files
+func Test_pacmanlog()
+ filetype on
+ for fname in ['pacman.log', 'pacman.log.1', 'pacman.log-20250123']
+ call writefile(["[2025-01-23T01:23:45+0000] [PACMAN] Running 'pacman -S -y
--config /etc/pacman.conf --'"], fname, 'D')
+ exe 'split ' .. fname
+ call assert_equal('pacmanlog', &filetype, 'for text: ' .. string(fname))
+ bwipe!
+ endfor
+ filetype off
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 812941804..2da49520a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1212,
/**/
1211,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1tttuy-00EZCx-Tz%40256bit.org.