CINXE.COM
vim: 991fbb7feb3e
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"> <head> <link rel="icon" href="/hgweb/vim/static/hgicon.png" type="image/png" /> <meta name="robots" content="index, nofollow" /> <link rel="stylesheet" href="/hgweb/vim/static/style-paper.css" type="text/css" /> <script type="text/javascript" src="/hgweb/vim/static/mercurial.js"></script> <title>vim: 991fbb7feb3e</title> </head> <body> <div class="container"> <div class="menu"> <div class="logo"> <a href="https://mercurial-scm.org/"> <img src="/hgweb/vim/static/hglogo.png" alt="mercurial" /></a> </div> <ul> <li><a href="/hgweb/vim/shortlog/991fbb7feb3e">log</a></li> <li><a href="/hgweb/vim/graph/991fbb7feb3e">graph</a></li> <li><a href="/hgweb/vim/tags">tags</a></li> <li><a href="/hgweb/vim/bookmarks">bookmarks</a></li> <li><a href="/hgweb/vim/branches">branches</a></li> </ul> <ul> <li class="active">changeset</li> <li><a href="/hgweb/vim/raw-rev/991fbb7feb3e">raw</a></li> <li><a href="/hgweb/vim/file/991fbb7feb3e">browse</a></li> </ul> <ul> </ul> <ul> <li><a href="/hgweb/vim/help">help</a></li> </ul> </div> <div class="main"> <h2 class="breadcrumb"><a href="/">Mercurial</a> > <a href="/hgweb">hgweb</a> > <a href="/hgweb/vim">vim</a> </h2> <h3> changeset 37513:<a href="/hgweb/vim/rev/991fbb7feb3e">991fbb7feb3e</a> </h3> <form class="search" action="/hgweb/vim/log"> <p><input name="rev" id="search1" type="text" size="30" value="" /></p> <div id="hint">Find changesets by keywords (author, files, the commit message), revision number or hash, or <a href="/hgweb/vim/help/revsets">revset expression</a>.</div> </form> <div class="description">patch 9.1.1212: filetype: logrotate'd pacmanlogs are not recognized Commit: https://github.com/vim/vim/commit/20d23ce93b84ea199d5ea56d7ec86f5e6846d6cc Author: Eisuke Kawashima <e-kwsm@users.noreply.github.com> 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 <e-kwsm@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org></div> <table id="changesetEntry"> <tr> <th class="author">author</th> <td class="author">Christian Brabandt <cb@256bit.org></td> </tr> <tr> <th class="date">date</th> <td class="date age">Sun, 16 Mar 2025 20:45:04 +0100</td> </tr> <tr> <th class="author">parents</th> <td class="author"><a href="/hgweb/vim/rev/1162e21572b4">1162e21572b4</a> </td> </tr> <tr> <th class="author">children</th> <td class="author"> <a href="/hgweb/vim/rev/2dc206b1fcba">2dc206b1fcba</a></td> </tr> <tr> <th class="files">files</th> <td class="files"><a href="/hgweb/vim/file/991fbb7feb3e/runtime/filetype.vim">runtime/filetype.vim</a> <a href="/hgweb/vim/file/991fbb7feb3e/src/testdir/test_filetype.vim">src/testdir/test_filetype.vim</a> <a href="/hgweb/vim/file/991fbb7feb3e/src/version.c">src/version.c</a> </td> </tr> <tr> <th class="diffstat">diffstat</th> <td class="diffstat"> 3 files changed, 15 insertions(+), 2 deletions(-) <a id="diffstatexpand" class="diffstattoggle" href="#">[<tt>+</tt>]</a> <div id="diffstatdetails" style="display:none;"> <a class="diffstattoggle" href="#">[<tt>-</tt>]</a> <table class="diffstat-table stripes2"> <tr> <td class="diffstat-file"><a href="#l1.1">runtime/filetype.vim</a></td> <td class="diffstat-total" align="right">2</td> <td class="diffstat-graph"> <span class="diffstat-add" style="width:7.6923076923076925%;"> </span> <span class="diffstat-remove" style="width:7.6923076923076925%;"> </span> </td> </tr> <tr> <td class="diffstat-file"><a href="#l2.1">src/testdir/test_filetype.vim</a></td> <td class="diffstat-total" align="right">13</td> <td class="diffstat-graph"> <span class="diffstat-add" style="width:92.3076923076923%;"> </span> <span class="diffstat-remove" style="width:7.6923076923076925%;"> </span> </td> </tr> <tr> <td class="diffstat-file"><a href="#l3.1">src/version.c</a></td> <td class="diffstat-total" align="right">2</td> <td class="diffstat-graph"> <span class="diffstat-add" style="width:15.384615384615385%;"> </span> <span class="diffstat-remove" style="width:0.0%;"> </span> </td> </tr> </table> </div> </td> </tr> </table> <div class="overflow"> <div class="sourcefirst linewraptoggle">line wrap: <a class="linewraplink" href="#">on</a></div> <div class="sourcefirst"> line diff</div> <div class="stripes2 diffblocks"> <div class="bottomline inc-lineno"><pre class="sourcelines wrap"> <span id="l1.1" class="minusline">--- a/runtime/filetype.vim</span><a href="#l1.1"></a> <span id="l1.2" class="plusline">+++ b/runtime/filetype.vim</span><a href="#l1.2"></a> <span id="l1.3" class="atline">@@ -1814,7 +1814,7 @@ au BufNewFile,BufRead *.hook</span><a href="#l1.3"></a> <span id="l1.4"> au BufNewFile,BufRead {.,}makepkg.conf setf sh</span><a href="#l1.4"></a> <span id="l1.5"> </span><a href="#l1.5"></a> <span id="l1.6"> " Pacman log</span><a href="#l1.6"></a> <span id="l1.7" class="minusline">-au BufNewFile,BufRead pacman.log setf pacmanlog</span><a href="#l1.7"></a> <span id="l1.8" class="plusline">+au BufRead pacman.log* call s:StarSetf('pacmanlog')</span><a href="#l1.8"></a> <span id="l1.9"> </span><a href="#l1.9"></a> <span id="l1.10"> " Pam conf</span><a href="#l1.10"></a> <span id="l1.11"> au BufNewFile,BufRead */etc/pam.conf setf pamconf</span><a href="#l1.11"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap"> <span id="l2.1" class="minusline">--- a/src/testdir/test_filetype.vim</span><a href="#l2.1"></a> <span id="l2.2" class="plusline">+++ b/src/testdir/test_filetype.vim</span><a href="#l2.2"></a> <span id="l2.3" class="atline">@@ -574,7 +574,6 @@ def s:GetFilenameChecks(): dict<list<str</span><a href="#l2.3"></a> <span id="l2.4"> opl: ['file.OPL', 'file.OPl', 'file.OpL', 'file.Opl', 'file.oPL', 'file.oPl', 'file.opL', 'file.opl'],</span><a href="#l2.4"></a> <span id="l2.5"> ora: ['file.ora'],</span><a href="#l2.5"></a> <span id="l2.6"> org: ['file.org', 'file.org_archive'],</span><a href="#l2.6"></a> <span id="l2.7" class="minusline">- pacmanlog: ['pacman.log'],</span><a href="#l2.7"></a> <span id="l2.8"> pamconf: ['/etc/pam.conf', '/etc/pam.d/file', 'any/etc/pam.conf', 'any/etc/pam.d/file'],</span><a href="#l2.8"></a> <span id="l2.9"> pamenv: ['/etc/security/pam_env.conf', '/home/user/.pam_environment', '.pam_environment', 'pam_env.conf'],</span><a href="#l2.9"></a> <span id="l2.10"> pandoc: ['file.pandoc', 'file.pdk', 'file.pd', 'file.pdc'],</span><a href="#l2.10"></a> <span id="l2.11" class="atline">@@ -2877,4 +2876,16 @@ func Test_org_file()</span><a href="#l2.11"></a> <span id="l2.12"> filetype off</span><a href="#l2.12"></a> <span id="l2.13"> endfunc</span><a href="#l2.13"></a> <span id="l2.14"> </span><a href="#l2.14"></a> <span id="l2.15" class="plusline">+" Filetypes detected from names of existing files</span><a href="#l2.15"></a> <span id="l2.16" class="plusline">+func Test_pacmanlog()</span><a href="#l2.16"></a> <span id="l2.17" class="plusline">+ filetype on</span><a href="#l2.17"></a> <span id="l2.18" class="plusline">+ for fname in ['pacman.log', 'pacman.log.1', 'pacman.log-20250123']</span><a href="#l2.18"></a> <span id="l2.19" class="plusline">+ call writefile(["[2025-01-23T01:23:45+0000] [PACMAN] Running 'pacman -S -y --config /etc/pacman.conf --'"], fname, 'D')</span><a href="#l2.19"></a> <span id="l2.20" class="plusline">+ exe 'split ' .. fname</span><a href="#l2.20"></a> <span id="l2.21" class="plusline">+ call assert_equal('pacmanlog', &filetype, 'for text: ' .. string(fname))</span><a href="#l2.21"></a> <span id="l2.22" class="plusline">+ bwipe!</span><a href="#l2.22"></a> <span id="l2.23" class="plusline">+ endfor</span><a href="#l2.23"></a> <span id="l2.24" class="plusline">+ filetype off</span><a href="#l2.24"></a> <span id="l2.25" class="plusline">+endfunc</span><a href="#l2.25"></a> <span id="l2.26" class="plusline">+</span><a href="#l2.26"></a> <span id="l2.27"> " vim: shiftwidth=2 sts=2 expandtab</span><a href="#l2.27"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap"> <span id="l3.1" class="minusline">--- a/src/version.c</span><a href="#l3.1"></a> <span id="l3.2" class="plusline">+++ b/src/version.c</span><a href="#l3.2"></a> <span id="l3.3" class="atline">@@ -705,6 +705,8 @@ static char *(features[]) =</span><a href="#l3.3"></a> <span id="l3.4"> static int included_patches[] =</span><a href="#l3.4"></a> <span id="l3.5"> { /* Add new patch number below this line */</span><a href="#l3.5"></a> <span id="l3.6"> /**/</span><a href="#l3.6"></a> <span id="l3.7" class="plusline">+ 1212,</span><a href="#l3.7"></a> <span id="l3.8" class="plusline">+/**/</span><a href="#l3.8"></a> <span id="l3.9"> 1211,</span><a href="#l3.9"></a> <span id="l3.10"> /**/</span><a href="#l3.10"></a> <span id="l3.11"> 1210,</span><a href="#l3.11"></a></pre></div> </div> </div> </div> </div> </body> </html>