From 4195b82ec9ed9c7c573bbcaaa642c5ab3c9f9167 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 15 Jul 2025 22:46:12 +0200 Subject: [PATCH] vim-patch:9.1.1548: filetype: OpenFGA files are not recognized Problem: filetype: OpenFGA files are not recognized Solution: detect *.fga files as fga filetype, include an fga filetype plugin (Riley Bruins) References: https://github.com/openfga https://marketplace.visualstudio.com/items?itemName=openfga.openfga-vscode closes: vim/vim#17752 https://github.com/vim/vim/commit/0992f62fc18431296d3d5d6ab04317b8de4c76d9 Co-authored-by: Riley Bruins --- runtime/ftplugin/fga.vim | 13 +++++++++++++ runtime/lua/vim/filetype.lua | 1 + test/old/testdir/test_filetype.vim | 1 + 3 files changed, 15 insertions(+) create mode 100644 runtime/ftplugin/fga.vim diff --git a/runtime/ftplugin/fga.vim b/runtime/ftplugin/fga.vim new file mode 100644 index 0000000000..8d9c6b3c6b --- /dev/null +++ b/runtime/ftplugin/fga.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: FGA +" Maintainer: Riley Bruins +" Last Change: 2025 Jul 14 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index fcd2ea9acf..73d56228b2 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -459,6 +459,7 @@ local extension = { fwt = 'fan', lib = 'faust', fnl = 'fennel', + fga = 'fga', m4gl = 'fgl', ['4gl'] = 'fgl', ['4gh'] = 'fgl', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 738e49e522..4f6df1600b 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -285,6 +285,7 @@ func s:GetFilenameChecks() abort \ 'faust': ['file.dsp', 'file.lib'], \ 'fennel': ['file.fnl', '.fennelrc', 'fennelrc'], \ 'fetchmail': ['.fetchmailrc'], + \ 'fga': ['file.fga'], \ 'fgl': ['file.4gl', 'file.4gh', 'file.m4gl'], \ 'firrtl': ['file.fir'], \ 'fish': ['file.fish'],