# HG changeset patch # User Bram Moolenaar # Date 1611237605 -3600 # Node ID eb30aed2059f00c43baa87d11f41a05e172548c6 # Parent 6d57492e46b72c48e9b91023864ecb5dbf3a0dba patch 8.2.2384: turtle filetype not recognized Commit: https://github.com/vim/vim/commit/5e6a7aa2b26077775906eb8411952dc6259694de Author: Bram Moolenaar Date: Thu Jan 21 14:45:13 2021 +0100 patch 8.2.2384: turtle filetype not recognized Problem: Turtle filetype not recognized. Solution: Add a rule to detect turtle files. (closes https://github.com/vim/vim/issues/7722) diff --git a/runtime/filetype.vim b/runtime/filetype.vim --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1731,8 +1731,13 @@ au BufNewFile,BufRead *.tli setf tli " Telix Salt au BufNewFile,BufRead *.slt setf tsalt -" Tera Term Language -au BufRead,BufNewFile *.ttl setf teraterm +" Tera Term Language or Turtle +au BufRead,BufNewFile *.ttl + \ if getline(1) =~ '^@\?\(prefix\|base\)' | + \ setf turtle | + \ else | + \ setf teraterm | + \ endif " Terminfo au BufNewFile,BufRead *.ti setf terminfo diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -733,6 +733,23 @@ func Test_ts_file() filetype off endfunc +func Test_ttl_file() + filetype on + + call writefile(['@base .'], 'Xfile.ttl') + split Xfile.ttl + call assert_equal('turtle', &filetype) + bwipe! + + call writefile(['looks like Tera Term Language'], 'Xfile.ttl') + split Xfile.ttl + call assert_equal('teraterm', &filetype) + bwipe! + + call delete('Xfile.ttl') + filetype off +endfunc + func Test_pp_file() filetype on diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2384, +/**/ 2383, /**/ 2382,