patch 9.0.0779: lsl and lm3 file extensions are not recognized
Problem: lsl and lm3 file extensions are not recognized.
Solution: Add *.lsl and *.lm3 patterns. (Doug Kearns, closes #11384)
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index d5c21ac..8f74445 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -1087,5 +1087,18 @@
endif
enddef
+export def FTlsl()
+ if exists("g:filetype_lsl")
+ exe "setf " .. g:filetype_lsl
+ endif
+
+ var line = getline(nextnonblank(1))
+ if line =~ '^\s*%' || line =~# ':\s*trait\s*$'
+ setf larch
+ else
+ setf lsl
+ endif
+enddef
+
# Uncomment this line to check for compilation errors early
# defcompile
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index d04e4ac..23501f0 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -150,6 +150,7 @@
*.fs g:filetype_fs |ft-forth-syntax|
*.i g:filetype_i |ft-progress-syntax|
*.inc g:filetype_inc
+ *.lsl g:filetype_lsl
*.m g:filetype_m |ft-mathematica-syntax|
*.mod g:filetype_mod
*.p g:filetype_p |ft-pascal-syntax|
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index eb4a5d7..f3fbfbc 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1032,6 +1032,9 @@
" Lace (ISE)
au BufNewFile,BufRead *.ace,*.ACE setf lace
+" Larch Shared Language
+au BufNewFile,BufRead .lsl call dist#ft#FTlsl()
+
" Latexmkrc
au BufNewFile,BufRead .latexmkrc,latexmkrc setf perl
@@ -1122,7 +1125,7 @@
au BufNewFile,BufRead *.rockspec setf lua
" Linden Scripting Language (Second Life)
-au BufNewFile,BufRead *.lsl setf lsl
+au BufNewFile,BufRead *.lsl call dist#ft#FTlsl()
" Lynx style file (or LotusScript!)
au BufNewFile,BufRead *.lss setf lss
@@ -1220,6 +1223,9 @@
" Modula-3 (.m3, .i3, .mg, .ig)
au BufNewFile,BufRead *.[mi][3g] setf modula3
+" Larch/Modula-3
+au BufNewFile,BufRead *.lm3 setf modula3
+
" Monk
au BufNewFile,BufRead *.isc,*.monk,*.ssc,*.tsc setf monk