robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Sean Dewarvim-patch:e978b4534a5e (#24697)cbf54ec2a5

master
912 B33 linesraw
1" Vim support file to switch on loading indent files for file types
2"
3" Maintainer:	The Vim Project <https://github.com/vim/vim>
4" Last Change:	2023 Aug 10
5" Former Maintainer:	Bram Moolenaar <Bram@vim.org>
6
7if exists("did_indent_on")
8  finish
9endif
10let did_indent_on = 1
11
12augroup filetypeindent
13  au FileType * call s:LoadIndent()
14  func! s:LoadIndent()
15    if exists("b:undo_indent")
16      exe b:undo_indent
17      unlet! b:undo_indent b:did_indent
18    endif
19    let s = expand("<amatch>")
20    if s != ""
21      if exists("b:did_indent")
22	unlet b:did_indent
23      endif
24
25      " When there is a dot it is used to separate filetype names.  Thus for
26      " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
27      for name in split(s, '\.')
28        " XXX: "[.]" in the pattern makes it a wildcard on Windows
29        exe $'runtime! indent/{name}[.]{{vim,lua}}'
30      endfor
31    endif
32  endfunc
33augroup END