Mercurial > vim
changeset 35658:699afc981962
runtime(filetype): Fix Prolog file detection regex
Commit: https://github.com/vim/vim/commit/7347642633eb2de23a78c51a4388c9080440eec4
Author: igna_martinoli <ignamartinoli@protonmail.com>
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 <ignamartinoli@protonmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 12 Jul 2024 07:45:10 +0200 |
parents | b7d6523899eb |
children | a60216ed43bd |
files | runtime/autoload/dist/ft.vim |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 =~ '\<prolog\>' || lnum =~ '(^\s*(:-\|%\|\/\*))\|.\s*$' + if lnum =~ '\<prolog\>' || lnum =~ '^\(:-\|%\|\/\*\)\|\.$' setf prolog else exe 'setf ' .. default