# HG changeset patch # User Christian Brabandt # Date 1720763110 -7200 # Node ID 699afc981962dafae65aaf582d0a3cba5016e4f9 # Parent b7d6523899eb0be141ca2115be26ca23877669b9 runtime(filetype): Fix Prolog file detection regex Commit: https://github.com/vim/vim/commit/7347642633eb2de23a78c51a4388c9080440eec4 Author: igna_martinoli Date: Fri Jul 12 07:32:21 2024 +0200 runtime(filetype): Fix Prolog file detection regex Problem: filetype: .pro file detection for Prolog is broken Solution: fixed the regex to only match on the tested cases (igna_martinoli) fixes: #10835 closes: #15206 Signed-off-by: igna_martinoli Signed-off-by: Christian Brabandt diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -465,7 +465,7 @@ export def ProtoCheck(default: string) # recognize Prolog by specific text in the first non-empty line # require a blank after the '%' because Perl uses "%list" and "%translate" var lnum = getline(nextnonblank(1)) - if lnum =~ '\' || lnum =~ '(^\s*(:-\|%\|\/\*))\|.\s*$' + if lnum =~ '\' || lnum =~ '^\(:-\|%\|\/\*\)\|\.$' setf prolog else exe 'setf ' .. default