summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGaetan Lepage <gaetan@glepage.com>2023-05-10 22:01:55 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-10 22:01:55 +0100
commit4ce1bda869e4ec0152d7dcbe1e491ceac5341d5e (patch)
tree349509e1ca04cb29840c2aa33b519a856567a7a4 /src
parent411da64e77ef9d8edd1a5aa80fa5b9a4b159c93d (diff)
downloadvim-git-4ce1bda869e4ec0152d7dcbe1e491ceac5341d5e.tar.gz
patch 9.0.1539: typst filetype is not recognizedv9.0.1539
Problem: Typst filetype is not recognized. Solution: Distinguish between sql and typst. (Gaetan Lepage, closes #12363)
Diffstat (limited to 'src')
-rw-r--r--src/testdir/test_filetype.vim33
-rw-r--r--src/version.c2
2 files changed, 34 insertions, 1 deletions
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index a68d7499a..3e90381b3 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -564,7 +564,7 @@ let s:filename_checks = {
\ 'spice': ['file.sp', 'file.spice'],
\ 'spup': ['file.speedup', 'file.spdata', 'file.spd'],
\ 'spyce': ['file.spy', 'file.spi'],
- \ 'sql': ['file.tyb', 'file.typ', 'file.tyc', 'file.pkb', 'file.pks'],
+ \ 'sql': ['file.tyb', 'file.tyc', 'file.pkb', 'file.pks'],
\ 'sqlj': ['file.sqlj'],
\ 'prql': ['file.prql'],
\ 'sqr': ['file.sqr', 'file.sqi'],
@@ -2047,4 +2047,35 @@ func Test_lsl_file()
filetype off
endfunc
+func Test_typ_file()
+ filetype on
+
+ " SQL type file
+
+ call writefile(['CASE = LOWER'], 'Xfile.typ', 'D')
+ split Xfile.typ
+ call assert_equal('sql', &filetype)
+ bwipe!
+
+ call writefile(['TYPE foo'], 'Xfile.typ')
+ split Xfile.typ
+ call assert_equal('sql', &filetype)
+ bwipe!
+
+ " typst document
+
+ call writefile(['this is a fallback'], 'Xfile.typ')
+ split Xfile.typ
+ call assert_equal('typst', &filetype)
+ bwipe!
+
+ let g:filetype_typ = 'typst'
+ split test.typ
+ call assert_equal('typst', &filetype)
+ bwipe!
+ unlet g:filetype_typ
+
+ filetype off
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 35a9708dc..5d55e4c5f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1539,
+/**/
1538,
/**/
1537,