aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/dist
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-08-09 10:43:28 +0200
committerGitHub <noreply@github.com>2022-08-09 10:43:28 +0200
commita5e846b9969b1dfbd7e92f437f3ac7905039b84f (patch)
tree04ea16853179df83e33bbc36a1d96168925d2bc2 /runtime/autoload/dist
parente6680ea7c3912d38f2ef967e053be741624633ad (diff)
downloadrneovim-a5e846b9969b1dfbd7e92f437f3ac7905039b84f.tar.gz
rneovim-a5e846b9969b1dfbd7e92f437f3ac7905039b84f.tar.bz2
rneovim-a5e846b9969b1dfbd7e92f437f3ac7905039b84f.zip
vim-patch:partial: 48c3f4e0bff7 (#19684)
vim-patch:partial:48c3f4e0bff7 Update runtime files https://github.com/vim/vim/commit/48c3f4e0bff7efd289a7001b68c777b6f89a7057 partially skip `options.txt` (needs 9.0.0138)
Diffstat (limited to 'runtime/autoload/dist')
-rw-r--r--runtime/autoload/dist/ft.vim11
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index a2f485dd67..77140d62b1 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -348,7 +348,7 @@ func dist#ft#FTidl()
setf idl
endfunc
-" Distinguish between "default" and Cproto prototype file. */
+" Distinguish between "default", Prolog and Cproto prototype file. */
func dist#ft#ProtoCheck(default)
" Cproto files have a comment in the first line and a function prototype in
" the second line, it always ends in ";". Indent files may also have
@@ -358,7 +358,14 @@ func dist#ft#ProtoCheck(default)
if getline(2) =~ '.;$'
setf cpp
else
- exe 'setf ' . a:default
+ " recognize Prolog by specific text in the first non-empty line
+ " require a blank after the '%' because Perl uses "%list" and "%translate"
+ let l = getline(nextnonblank(1))
+ if l =~ '\<prolog\>' || l =~ '^\s*\(%\+\(\s\|$\)\|/\*\)' || l =~ ':-'
+ setf prolog
+ else
+ exe 'setf ' .. a:default
+ endif
endif
endfunc