To: vim_dev@googlegroups.com Subject: Patch 9.0.0779 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0779 Problem: lsl and lm3 file extensions are not recognized. Solution: Add *.lsl and *.lm3 patterns. (Doug Kearns, closes #11384) Files: runtime/autoload/dist/ft.vim, runtime/doc/filetype.txt, runtime/filetype.vim, src/testdir/test_filetype.vim *** ../vim-9.0.0778/runtime/autoload/dist/ft.vim 2022-10-16 12:49:08.591842875 +0100 --- runtime/autoload/dist/ft.vim 2022-10-17 13:27:51.086030681 +0100 *************** *** 1087,1091 **** --- 1087,1104 ---- 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 *** ../vim-9.0.0778/runtime/doc/filetype.txt 2022-06-30 16:25:14.782979300 +0100 --- runtime/doc/filetype.txt 2022-10-17 13:27:51.086030681 +0100 *************** *** 150,155 **** --- 150,156 ---- *.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| *** ../vim-9.0.0778/runtime/filetype.vim 2022-10-14 20:24:20.305925354 +0100 --- runtime/filetype.vim 2022-10-17 13:27:51.086030681 +0100 *************** *** 1032,1037 **** --- 1032,1040 ---- " 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,1128 **** au BufNewFile,BufRead *.rockspec setf lua " Linden Scripting Language (Second Life) ! au BufNewFile,BufRead *.lsl setf lsl " Lynx style file (or LotusScript!) au BufNewFile,BufRead *.lss setf lss --- 1125,1131 ---- au BufNewFile,BufRead *.rockspec setf lua " Linden Scripting Language (Second Life) ! au BufNewFile,BufRead *.lsl call dist#ft#FTlsl() " Lynx style file (or LotusScript!) au BufNewFile,BufRead *.lss setf lss *************** *** 1220,1225 **** --- 1223,1231 ---- " 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 *** ../vim-9.0.0778/src/testdir/test_filetype.vim 2022-10-16 12:49:08.591842875 +0100 --- src/testdir/test_filetype.vim 2022-10-17 13:27:51.086030681 +0100 *************** *** 365,371 **** \ 'mmp': ['file.mmp'], \ 'modconf': ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'], \ 'modula2': ['file.m2', 'file.mi'], ! \ 'modula3': ['file.m3', 'file.mg', 'file.i3', 'file.ig'], \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], \ 'moo': ['file.moo'], \ 'moonscript': ['file.moon'], --- 365,371 ---- \ 'mmp': ['file.mmp'], \ 'modconf': ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'], \ 'modula2': ['file.m2', 'file.mi'], ! \ 'modula3': ['file.m3', 'file.mg', 'file.i3', 'file.ig', 'file.lm3'], \ 'monk': ['file.isc', 'file.monk', 'file.ssc', 'file.tsc'], \ 'moo': ['file.moo'], \ 'moonscript': ['file.moon'], *************** *** 1929,1934 **** --- 1929,1965 ---- bwipe! filetype off + endfunc + + func Test_lsl_file() + filetype on + + call writefile(['looks like Linden Scripting Language'], 'Xfile.lsl', 'D') + split Xfile.lsl + call assert_equal('lsl', &filetype) + bwipe! + + " Test dist#ft#FTlsl() + + let g:filetype_lsl = 'larch' + split Xfile.lsl + call assert_equal('larch', &filetype) + bwipe! + unlet g:filetype_lsl + + " Larch Shared Language + + call writefile(['% larch comment'], 'Xfile.lsl') + split Xfile.lsl + call assert_equal('larch', &filetype) + bwipe! + + call writefile(['foo: trait'], 'Xfile.lsl') + split Xfile.lsl + call assert_equal('larch', &filetype) + bwipe! + + filetype off endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0778/src/version.c 2022-10-17 13:13:28.705183595 +0100 --- src/version.c 2022-10-17 13:31:30.741980345 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 779, /**/ -- What do you get when you cross a joke with a rehtorical question? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///