From 5c2616846aa4d85ba96adefea98ed50f46f7a291 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 20 May 2024 14:24:46 +0200 Subject: [PATCH] vim-patch:9.1.0425: filetype: purescript files are not recognized Problem: filetype: purescript files are not recognized Solution: recognize '*.purs' files as purescript filetype, include basic purescript filetype plugin (Riley Bruins) Reference: https://github.com/purescript/documentation/blob/master/language/Syntax.md#comments closes: vim/vim#14813 https://github.com/vim/vim/commit/155583a5c317881e60828e3972383436ac197ee8 Co-authored-by: Riley Bruins --- runtime/ftplugin/purescript.vim | 14 ++++++++++++++ runtime/lua/vim/filetype.lua | 1 + test/old/testdir/test_filetype.vim | 1 + 3 files changed, 16 insertions(+) create mode 100644 runtime/ftplugin/purescript.vim diff --git a/runtime/ftplugin/purescript.vim b/runtime/ftplugin/purescript.vim new file mode 100644 index 0000000000..b3300bb324 --- /dev/null +++ b/runtime/ftplugin/purescript.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: purescript +" Maintainer: Riley Bruins +" Last Change: 2024 May 19 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=s1f:{-,mb:\ ,ex:-},:--\ \|,:-- +setl commentstring=--\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 97e69c0ca8..b158cd83ba 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -845,6 +845,7 @@ local extension = { psf = 'psf', psl = 'psl', pug = 'pug', + purs = 'purescript', arr = 'pyret', pxd = 'pyrex', pyx = 'pyrex', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 08f619a119..b889c9056c 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -578,6 +578,7 @@ func s:GetFilenameChecks() abort \ 'psl': ['file.psl'], \ 'pug': ['file.pug'], \ 'puppet': ['file.pp'], + \ 'purescript': ['file.purs'], \ 'pymanifest': ['MANIFEST.in'], \ 'pyret': ['file.arr'], \ 'pyrex': ['file.pyx', 'file.pxd'],