diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-04-06 18:57:39 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-06 18:57:39 +0100 |
commit | 3ad2090316edc85e93094bba7af64f9991cc7f85 (patch) | |
tree | 8900987b6527fa7a8864c360b63612025ab3dc6a /runtime | |
parent | c947b9ae419114ebfef9725814ea41a466fcf879 (diff) |
patch 8.2.4701: Kuka Robot Language files not recognizedv8.2.4701
Problem: Kuka Robot Language files not recognized.
Solution: Recognize *.src and *.dat files. (Patrick Meiser-Knosowski,
closes #10096)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/dist/ft.vim | 17 | ||||
-rw-r--r-- | runtime/filetype.vim | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index a36f615d61..fd14062356 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -896,6 +896,23 @@ export def FTtf() setf tf enddef +# Determine if a *.src file is Kuka Robot Language +export def FTsrc() + if exists("g:filetype_src") + exe "setf " .. g:filetype_src + elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)' + setf krl + endif +enddef + +# Determine if a *.dat file is Kuka Robot Language +export def FTdat() + if exists("g:filetype_dat") + exe "setf " .. g:filetype_dat + elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)' + setf krl + endif +enddef # Uncomment this line to check for compilation errors early # defcompile diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 7aeed626a9..9d63a7fe89 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -951,6 +951,11 @@ au BufNewFile,BufRead *.jl setf julia " Kixtart au BufNewFile,BufRead *.kix setf kix +" Kuka Robot Language +au BufNewFile,BufRead *.src\c call dist#ft#FTsrc() +au BufNewFile,BufRead *.dat\c call dist#ft#FTdat() +au BufNewFile,BufRead *.sub\c setf krl + " Kimwitu[++] au BufNewFile,BufRead *.k setf kwt |