diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-01-14 20:56:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 20:56:30 -0500 |
commit | 0fad952a2b7d90d2c3215e8e3c50ae62233e2158 (patch) | |
tree | dd4d33f99fb2af6253a5809d6c8dd86ce091f1d6 /runtime/autoload | |
parent | 2390a0d3c412060eeeec2c7076a2014e2834eb10 (diff) | |
parent | d953614e72c266a911bf9752dc25abe4c839a78d (diff) | |
download | rneovim-0fad952a2b7d90d2c3215e8e3c50ae62233e2158.tar.gz rneovim-0fad952a2b7d90d2c3215e8e3c50ae62233e2158.tar.bz2 rneovim-0fad952a2b7d90d2c3215e8e3c50ae62233e2158.zip |
Merge pull request #13750 from janlazo/vim-8.2.2329
vim-patch:8.2.{2329,2334}
Diffstat (limited to 'runtime/autoload')
-rw-r--r-- | runtime/autoload/dist/ft.vim | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index b6297472c3..cf26bc3172 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -362,6 +362,10 @@ func dist#ft#FTinc() setf aspvbs elseif lines =~ "<?" setf php + " Pascal supports // comments but they're vary rarely used for file + " headers so assume POV-Ray + elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords + setf pascal else call dist#ft#FTasmsyntax() if exists("b:asmsyntax") @@ -408,6 +412,9 @@ func dist#ft#FTprogress_asm() setf progress endfunc +let s:ft_pascal_comments = '^\s*\%({\|(\*\|//\)' +let s:ft_pascal_keywords = '^\s*\%(program\|unit\|library\|uses\|begin\|procedure\|function\|const\|type\|var\)\>' + func dist#ft#FTprogress_pascal() if exists("g:filetype_p") exe "setf " . g:filetype_p @@ -419,8 +426,7 @@ func dist#ft#FTprogress_pascal() let lnum = 1 while lnum <= 10 && lnum < line('$') let line = getline(lnum) - if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>' - \ || line =~ '^\s*{' || line =~ '^\s*(\*' + if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords setf pascal return elseif line !~ '^\s*$' || line =~ '^/\*' @@ -433,6 +439,19 @@ func dist#ft#FTprogress_pascal() setf progress endfunc +func dist#ft#FTpp() + if exists("g:filetype_pp") + exe "setf " . g:filetype_pp + else + let line = getline(nextnonblank(1)) + if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords + setf pascal + else + setf puppet + endif + endif +endfunc + func dist#ft#FTr() let max = line("$") > 50 ? 50 : line("$") |