aboutsummaryrefslogtreecommitdiff
path: root/runtime/autoload/dist
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/autoload/dist')
-rw-r--r--runtime/autoload/dist/ft.vim19
1 files changed, 18 insertions, 1 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 77140d62b1..7333e5a7e7 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -468,7 +468,7 @@ endfunc
" Returns true if file content looks like LambdaProlog module
func IsLProlog()
- " skip apparent comments and blank lines, what looks like
+ " skip apparent comments and blank lines, what looks like
" LambdaProlog comment may be RAPID header
let l = nextnonblank(1)
while l > 0 && l < line('$') && getline(l) =~ '^\s*%' " LambdaProlog comment
@@ -877,6 +877,23 @@ func dist#ft#FTsig()
endif
endfunc
+" This function checks the first 100 lines of files matching "*.sil" to
+" resolve detection between Swift Intermediate Language and SILE.
+func dist#ft#FTsil()
+ for lnum in range(1, [line('$'), 100]->min())
+ let line = getline(lnum)
+ if line =~ '^\s*[\\%]'
+ setf sile
+ return
+ elseif line =~ '^\s*\S'
+ setf sil
+ return
+ endif
+ endfor
+ " no clue, default to "sil"
+ setf sil
+endfunc
+
func dist#ft#FTsys()
if exists("g:filetype_sys")
exe "setf " .. g:filetype_sys