patch 9.1.0778: filetype: lf config files are not recognized

Commit: 
https://github.com/vim/vim/commit/0f146b7925178a5bdfdc8e07642976f0b76d9612
Author: Andis Spriņķis <spr.an...@protonmail.com>
Date:   Sun Oct 13 19:29:56 2024 +0200

    patch 9.1.0778: filetype: lf config files are not recognized
    
    Problem:  filetype: lf config files are not recognized
    Solution: detect lfrc files as lf filetype, include a syntax
              script for lf files (Andis Spriņķis).
    
    References:
    - https://github.com/gokcehan/lf
    
    closes: #15859
    
    Signed-off-by: Andis Spriņķis <spr.an...@protonmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS
index e4440a40e..e24fbc4c8 100644
--- a/.github/MAINTAINERS
+++ b/.github/MAINTAINERS
@@ -494,6 +494,7 @@ runtime/syntax/kotlin.vim           @udalov
 runtime/syntax/kdl.vim                 @imsnif @jiangyinzuo
 runtime/syntax/krl.vim                 @KnoP-01
 runtime/syntax/less.vim                        @genoma
+runtime/syntax/lf.vim                  @andis-sprinkis
 runtime/syntax/liquid.vim              @tpope
 runtime/syntax/lua.vim                 @marcuscf
 runtime/syntax/lyrics.vim              @ObserverOfTime
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 6b7dbf908..29bb7b50d 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*   For Vim version 9.1.  Last change: 2024 Oct 06
+*syntax.txt*   For Vim version 9.1.  Last change: 2024 Oct 13
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -2223,6 +2223,20 @@ define the vim variable 'lace_case_insensitive' in your 
startup file: >
        :let lace_case_insensitive=1
 
 
+LF (LFRC)              *lf.vim* *ft-lf-syntax* *g:lf_shell_syntax*
+                                               *b:lf_shell_syntax*
+
+For the lf file manager configuration files (lfrc) the shell commands
+syntax highlighting can be changed globally and per buffer by setting
+a different 'include' command search pattern using these variables:
+       let g:lf_shell_syntax = "syntax/dosbatch.vim"
+       let b:lf_shell_syntax = "syntax/zsh.vim"
+
+These variables are unset by default.
+
+The default 'include' command search pattern is 'syntax/sh.vim'.
+
+
 LEX                                            *lex.vim* *ft-lex-syntax*
 
 Lex uses brute-force synchronizing as the "^%%$" section delimiter
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 246ea96ce..8dee55dcd 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -6121,6 +6121,7 @@ b:changelog_name  filetype.txt    /*b:changelog_name*
 b:clojure_syntax_keywords      syntax.txt      /*b:clojure_syntax_keywords*
 b:clojure_syntax_without_core_keywords syntax.txt      
/*b:clojure_syntax_without_core_keywords*
 b:current_syntax-variable      syntax.txt      /*b:current_syntax-variable*
+b:lf_shell_syntax      syntax.txt      /*b:lf_shell_syntax*
 b:netrw_lastfile       pi_netrw.txt    /*b:netrw_lastfile*
 b:rust_cargo_avoid_whole_workspace     ft_rust.txt     
/*b:rust_cargo_avoid_whole_workspace*
 b:rust_cargo_check_all_features        ft_rust.txt     
/*b:rust_cargo_check_all_features*
@@ -7331,6 +7332,7 @@ ft-json-syntax    syntax.txt      /*ft-json-syntax*
 ft-ksh-syntax  syntax.txt      /*ft-ksh-syntax*
 ft-lace-syntax syntax.txt      /*ft-lace-syntax*
 ft-lex-syntax  syntax.txt      /*ft-lex-syntax*
+ft-lf-syntax   syntax.txt      /*ft-lf-syntax*
 ft-lifelines-syntax    syntax.txt      /*ft-lifelines-syntax*
 ft-lisp-syntax syntax.txt      /*ft-lisp-syntax*
 ft-lite-syntax syntax.txt      /*ft-lite-syntax*
@@ -7581,6 +7583,7 @@ g:html_use_encoding       syntax.txt      
/*g:html_use_encoding*
 g:html_use_input_for_pc        syntax.txt      /*g:html_use_input_for_pc*
 g:html_use_xhtml       syntax.txt      /*g:html_use_xhtml*
 g:html_whole_filler    syntax.txt      /*g:html_whole_filler*
+g:lf_shell_syntax      syntax.txt      /*g:lf_shell_syntax*
 g:markdown_fenced_languages    syntax.txt      /*g:markdown_fenced_languages*
 g:markdown_minlines    syntax.txt      /*g:markdown_minlines*
 g:markdown_syntax_conceal      syntax.txt      /*g:markdown_syntax_conceal*
@@ -8556,6 +8559,7 @@ len()     builtin.txt     /*len()*
 less   various.txt     /*less*
 letter print.txt       /*letter*
 lex.vim        syntax.txt      /*lex.vim*
+lf.vim syntax.txt      /*lf.vim*
 lhaskell.vim   syntax.txt      /*lhaskell.vim*
 libcall()      builtin.txt     /*libcall()*
 libcallnr()    builtin.txt     /*libcallnr()*
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index a0f3f4afd..2674002c3 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1315,6 +1315,9 @@ au BufNewFile,BufRead *.lean                      setf 
lean
 " Ledger
 au BufRead,BufNewFile *.ldg,*.ledger,*.journal                 setf ledger
 
+" lf configuration (lfrc)
+au BufNewFile,BufRead lfrc                     setf lf
+
 " Less
 au BufNewFile,BufRead *.less                   setf less
 
diff --git a/runtime/syntax/lf.vim b/runtime/syntax/lf.vim
new file mode 100644
index 000000000..e4cf01486
--- /dev/null
+++ b/runtime/syntax/lf.vim
@@ -0,0 +1,236 @@
+" Vim syntax file
+" Language: lf file manager configuration file (lfrc)
+" Maintainer: Andis Sprinkis <an...@sprinkis.com>
+" Former Maintainer: Cameron Wright
+" Former URL: https://github.com/andis-sprinkis/lf-vim
+" Last Change: 13 October 2024
+"
+" The shell syntax highlighting is configurable. See $VIMRUNTIME/doc/syntax.txt
+" lf version: 32
+
+if exists("b:current_syntax")
+    finish
+endif
+
+let b:current_syntax = "lf"
+
+"{{{ Comment Matching
+syn match    lfComment        '#.*$'
+"}}}
+
+"{{{ String Matching
+syn match    lfString         "'.*'"
+syn match    lfString         '".*"' contains=lfVar,lfSpecial
+"}}}
+
+"{{{ Match lf Variables
+syn match    lfVar            '\$f\|\$fx\|\$fs\|\$id'
+"}}}
+
+"{{{ Keywords
+syn keyword  lfKeyword        set setlocal cmd map cmap skipwhite
+"}}}
+
+"{{{ Options Keywords
+syn keyword  lfOptions
+    \ quit
+    \ up
+    \ half-up
+    \ page-up
+    \ scroll-up
+    \ down
+    \ half-down
+    \ page-down
+    \ scroll-down
+    \ updir
+    \ open
+    \ jump-next
+    \ jump-prev
+    \ top
+    \ bottom
+    \ high
+    \ middle
+    \ low
+    \ toggle
+    \ invert
+    \ invert-below
+    \ unselect
+    \ glob-select
+    \ glob-unselect
+    \ calcdirsize
+    \ clearmaps
+    \ copy
+    \ cut
+    \ paste
+    \ clear
+    \ sync
+    \ draw
+    \ redraw
+    \ load
+    \ reload
+    \ echo
+    \ echomsg
+    \ echoerr
+    \ cd
+    \ select
+    \ delete
+    \ rename
+    \ source
+    \ push
+    \ read
+    \ shell
+    \ shell-pipe
+    \ shell-wait
+    \ shell-async
+    \ find
+    \ find-back
+    \ find-next
+    \ find-prev
+    \ search
+    \ search-back
+    \ search-next
+    \ search-prev
+    \ filter
+    \ setfilter
+    \ mark-save
+    \ mark-load
+    \ mark-remove
+    \ tag
+    \ tag-toggle
+    \ cmd-escape
+    \ cmd-complete
+    \ cmd-menu-complete
+    \ cmd-menu-complete-back
+    \ cmd-menu-accept
+    \ cmd-enter
+    \ cmd-interrupt
+    \ cmd-history-next
+    \ cmd-history-prev
+    \ cmd-left
+    \ cmd-right
+    \ cmd-home
+    \ cmd-end
+    \ cmd-delete
+    \ cmd-delete-back
+    \ cmd-delete-home
+    \ cmd-delete-end
+    \ cmd-delete-unix-word
+    \ cmd-yank
+    \ cmd-transpose
+    \ cmd-transpose-word
+    \ cmd-word
+    \ cmd-word-back
+    \ cmd-delete-word
+    \ cmd-delete-word-back
+    \ cmd-capitalize-word
+    \ cmd-uppercase-word
+    \ cmd-lowercase-word
+    \ anchorfind
+    \ autoquit
+    \ borderfmt
+    \ cleaner
+    \ copyfmt
+    \ cursoractivefmt
+    \ cursorparentfmt
+    \ cursorpreviewfmt
+    \ cutfmt
+    \ dircache
+    \ dircounts
+    \ dirfirst
+    \ dironly
+    \ dirpreviews
+    \ drawbox
+    \ dupfilefmt
+    \ errorfmt
+    \ filesep
+    \ findlen
+    \ globfilter
+    \ globsearch
+    \ hidden
+    \ hiddenfiles
+    \ hidecursorinactive
+    \ history
+    \ icons
+    \ ifs
+    \ ignorecase
+    \ ignoredia
+    \ incfilter
+    \ incsearch
+    \ info
+    \ infotimefmtnew
+    \ infotimefmtold
+    \ mouse
+    \ number
+    \ numberfmt
+    \ period
+    \ preserve
+    \ preview
+    \ previewer
+    \ promptfmt
+    \ ratios
+    \ relativenumber
+    \ reverse
+    \ roundbox
+    \ ruler
+    \ rulerfmt
+    \ scrolloff
+    \ selectfmt
+    \ selmode
+    \ shell
+    \ shellflag
+    \ shellopts
+    \ sixel
+    \ smartcase
+    \ smartdia
+    \ sortby
+    \ statfmt
+    \ tabstop
+    \ tagfmt
+    \ tempmarks
+    \ timefmt
+    \ truncatechar
+    \ truncatepct
+    \ waitmsg
+    \ wrapscan
+    \ wrapscroll
+    \ pre-cd
+    \ on-cd
+    \ on-select
+    \ on-redraw
+    \ on-quit
+"}}}
+
+"{{{ Special Matching
+syn match    lfSpecial        '<.*>\|\.'
+"}}}
+
+"{{{ Shell Script Matching for cmd
+let s:shell_syntax = get(g:, 'lf_shell_syntax', "syntax/sh.vim")
+let s:shell_syntax = get(b:, 'lf_shell_syntax', s:shell_syntax)
+unlet b:current_syntax
+exe 'syn include @Shell '.s:shell_syntax
+let b:current_syntax = "lf"
+syn region   lfIgnore         start=".{{
" end="^}}"
+    \ keepend contains=lfExternalShell,lfExternalPatch
+syn match    lfShell          '\$[a-zA-Z].*$
+    \|:[a-zA-Z].*$
+    \|%[a-zA-Z].*$
+    \|![a-zA-Z].*$
+    \|&[a-zA-Z].*$'
+    \ transparent contains=@Shell,lfExternalPatch
+syn match    lfExternalShell  "^.*$" transparent contained contains=@Shell
+syn match    lfExternalPatch  "^\s*cmd\ .*\ .{{$\|^}}$" contained
+"}}}
+
+"{{{ Link Highlighting
+hi def link  lfComment        Comment
+hi def link  lfVar            Type
+hi def link  lfSpecial        Special
+hi def link  lfString         String
+hi def link  lfKeyword        Statement
+hi def link  lfOptions        Constant
+hi def link  lfConstant       Constant
+hi def link  lfExternalShell  Normal
+hi def link  lfExternalPatch  Special
+hi def link  lfIgnore         Special
+"}}}
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 474d51312..4fe5201cc 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -409,6 +409,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     ledger: ['file.ldg', 'file.ledger', 'file.journal'],
     less: ['file.less'],
     lex: ['file.lex', 'file.l', 'file.lxx', 'file.l++'],
+    lf: ['lfrc'],
     lftp: ['lftp.conf', '.lftprc', 'anylftp/rc', 'lftp/rc', 'some-lftp/rc'],
     lhaskell: ['file.lhs'],
     libao: ['/etc/libao.conf', '/.libao', 'any/.libao', 'any/etc/libao.conf'],
diff --git a/src/version.c b/src/version.c
index 53af2406b..221b32ec3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    778,
 /**/
     777,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1t02eN-00EciP-QK%40256bit.org.

Raspunde prin e-mail lui