Use "helm" filtype first for vim modeline + tests

"helm" can be managed by vim/neovim plugins, so it's a good idea to add
it as default, then use "gotmpl.yaml".

Add basic tests...
This commit is contained in:
2024-04-11 09:35:25 +02:00
parent c41fa22c59
commit ab15614076
3 changed files with 122 additions and 1 deletions

View File

@@ -317,7 +317,7 @@ func addStorageClassHelp(values []byte) []byte {
// addModeline adds a modeline to the values.yaml file to make sure that vim
// will use the correct syntax highlighting.
func addModeline(values []byte) []byte {
modeline := "# vi" + "m: ft=gotmpl.yaml"
modeline := "# vi" + "m: ft=helm.gotmpl.yaml"
// if the values ends by `{{- end }}` we need to add the modeline before
lines := strings.Split(string(values), "\n")