diff options
author | KnoP-01 <knosowski@graeffrobotics.de> | 2022-04-16 21:14:04 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-16 21:14:04 +0100 |
commit | 93c7a45e86934a92ec513b437fe9b8cc343c53e3 (patch) | |
tree | cd28cac256b8b83f39d7bc778048df0fe98775cf /runtime/autoload | |
parent | 047a7019b293918343998ccbdfabd48c771f5eef (diff) |
patch 8.2.4766: KRL files using "deffct" not recognizedv8.2.4766
Problem: KRL files using "deffct" not recognized.
Solution: Adjust the pattern used for matching. (Patrick Meiser-Knosowski,
closes #10200)
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/dist/ft.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 4c2d20ae71..05a92bc224 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -989,20 +989,23 @@ export def FTtf() setf tf enddef +var ft_krl_header = '\&\w+' # Determine if a *.src file is Kuka Robot Language export def FTsrc() + var ft_krl_def_or_deffct = '%(global\s+)?def%(fct)?>' if exists("g:filetype_src") exe "setf " .. g:filetype_src - elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)' + elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. ft_krl_header .. '|' .. ft_krl_def_or_deffct .. ')' setf krl endif enddef # Determine if a *.dat file is Kuka Robot Language export def FTdat() + var ft_krl_defdat = 'defdat>' if exists("g:filetype_dat") exe "setf " .. g:filetype_dat - elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)' + elseif getline(nextnonblank(1)) =~? '\v^\s*%(' .. ft_krl_header .. '|' .. ft_krl_defdat .. ')' setf krl endif enddef |