# HG changeset patch # User Christian Brabandt # Date 1730747703 -3600 # Node ID e6ef0fa6a170c21cb2db49ed209e552ef36eeb11 # Parent 1b4c18083d08d98daf074b10e6827f2dc04a7797 patch 9.1.0839: filetype: leo files are not recognized Commit: https://github.com/vim/vim/commit/93f65a4ab8168c766e4d3794607762b52762ef82 Author: Riley Bruins Date: Mon Nov 4 19:58:45 2024 +0100 patch 9.1.0839: filetype: leo files are not recognized Problem: filetype: leo files are not recognized Solution: detect '*.leo' files as leo filetype, include a filetype plugin (Riley Bruins) References: https://github.com/ProvableHQ/leo closes: #15988 Signed-off-by: Riley Bruins Signed-off-by: Christian Brabandt diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -202,6 +202,7 @@ runtime/ftplugin/kdl.vim @imsnif @jiang runtime/ftplugin/kivy.vim @ribru17 runtime/ftplugin/kotlin.vim @udalov runtime/ftplugin/ldapconf.vim @ribru17 +runtime/ftplugin/leo.vim @ribru17 runtime/ftplugin/less.vim @genoma runtime/ftplugin/lex.vim @ribru17 runtime/ftplugin/liquid.vim @tpope diff --git a/runtime/filetype.vim b/runtime/filetype.vim --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1325,6 +1325,9 @@ au BufRead,BufNewFile *.ldg,*.ledger,*.j " lf configuration (lfrc) au BufNewFile,BufRead lfrc setf lf +" Leo +au BufNewFile,BufRead *.leo setf leo + " Less au BufNewFile,BufRead *.less setf less diff --git a/runtime/ftplugin/leo.vim b/runtime/ftplugin/leo.vim new file mode 100644 --- /dev/null +++ b/runtime/ftplugin/leo.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Leo +" Maintainer: Riley Bruins +" Last Change: 2024 Nov 03 + +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/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim --- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -408,6 +408,7 @@ def s:GetFilenameChecks(): dict