Mercurial > vim
changeset 36470:e6ef0fa6a170 draft v9.1.0839
patch 9.1.0839: filetype: leo files are not recognized
Commit: https://github.com/vim/vim/commit/93f65a4ab8168c766e4d3794607762b52762ef82
Author: Riley Bruins <ribru17@hotmail.com>
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 <ribru17@hotmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 04 Nov 2024 20:15:03 +0100 |
parents | 1b4c18083d08 |
children | 7438e0f97224 |
files | .github/MAINTAINERS runtime/filetype.vim runtime/ftplugin/leo.vim src/testdir/test_filetype.vim src/version.c |
diffstat | 5 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
new file mode 100644 --- /dev/null +++ b/runtime/ftplugin/leo.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Leo +" Maintainer: Riley Bruins <ribru17@gmail.com> +" 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<'
--- a/src/testdir/test_filetype.vim +++ b/src/testdir/test_filetype.vim @@ -408,6 +408,7 @@ def s:GetFilenameChecks(): dict<list<str ldif: ['file.ldif'], lean: ['file.lean'], ledger: ['file.ldg', 'file.ledger', 'file.journal'], + leo: ['file.leo'], less: ['file.less'], lex: ['file.lex', 'file.l', 'file.lxx', 'file.l++'], lf: ['lfrc'],