commit ba40a6dbe3a1c98a9f75e56c7cd08ecd522d27dd
parent 65b9499e4a761e4e76e0e1e60cb507c4d6232bd9
Author: Christian Clason <c.clason@uni-graz.at>
Date: Mon, 4 Nov 2024 20:03:10 +0100
vim-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: vim/vim#15988
https://github.com/vim/vim/commit/93f65a4ab8168c766e4d3794607762b52762ef82
Co-authored-by: Riley Bruins <ribru17@hotmail.com>
Diffstat:
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/runtime/ftplugin/leo.vim 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<'
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
@@ -670,6 +670,7 @@ local extension = {
journal = 'ledger',
ldg = 'ledger',
ledger = 'ledger',
+ leo = 'leo',
less = 'less',
lex = 'lex',
lxx = 'lex',
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
@@ -408,6 +408,7 @@ func s:GetFilenameChecks() abort
\ 'lean': ['file.lean'],
\ 'ledger': ['file.ldg', 'file.ledger', 'file.journal'],
\ 'less': ['file.less'],
+ \ 'leo': ['file.leo'],
\ 'lex': ['file.lex', 'file.l', 'file.lxx', 'file.l++'],
\ 'lf': ['lfrc'],
\ 'lftp': ['lftp.conf', '.lftprc', 'anylftp/rc', 'lftp/rc', 'some-lftp/rc'],