File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ function ! puppet#include#IncludeExpr (fname) abort
2+ " Remove puppet 3.x style leading :: since they mean nothing for the path
3+ let l: fname = substitute (a: fname , ' ^::' , ' ' , ' ' )
4+
5+ " If we can't find a second element, then we're referring to the init.pp
6+ " file
7+ if match (l: fname , ' ::' ) < 0
8+ return ' init'
9+ endif
10+
11+ " Remove first element. It'll make finding files easier since the module
12+ " name might not be in the find path.
13+ let l: fname = substitute (l: fname ,' ^[^:]\+::' ,' ' ,' ' )
14+
15+ " Replace all subsequent :: in order to get a real file path
16+ let l: fname = substitute (l: fname ,' ::' ,' /' ,' g' )
17+
18+ return l: fname
19+ endfunction
Original file line number Diff line number Diff line change @@ -21,8 +21,13 @@ setlocal commentstring=#\ %s
2121setlocal formatoptions -= t formatoptions += croql
2222setlocal formatexpr = puppet#format#Format ()
2323
24+ setlocal suffixesadd = .pp
25+ setlocal include = \\ v ^\\ s * (include \| contain\| class \\ s + \\ \{\| Class\\ s + \\ \[ )\\ s + [\" \' ]?\\ zs (\\ f \| ::)+
26+ setlocal includeexpr = puppet#include#IncludeExpr (v: fname )
27+
2428let b: undo_ftplugin = "
2529 \ setlocal tabstop < tabstop < softtabstop < shiftwidth < expandtab <
2630 \| setlocal keywordprg < iskeyword < comments < commentstring <
2731 \| setlocal formatoptions < formatexpr <
32+ \| setlocal suffixesadd < include < includeexpr <
2833 \"
You can’t perform that action at this time.
0 commit comments