diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-09-25 20:34:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-09-25 20:34:21 +0200 |
commit | ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7 (patch) | |
tree | b081d09eab19c8dd4ebbf56a6d304809aba3852f /runtime/indent/yaml.vim | |
parent | c1d20998d71f3fa0aebeeee42007a337cd7e3d8a (diff) |
Update various runtime files.
Diffstat (limited to 'runtime/indent/yaml.vim')
-rw-r--r-- | runtime/indent/yaml.vim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim index 1d03715773..95a53b1386 100644 --- a/runtime/indent/yaml.vim +++ b/runtime/indent/yaml.vim @@ -1,6 +1,7 @@ " Vim indent file " Language: YAML " Maintainer: Nikolai Pavlov <zyx.vim@gmail.com> +" Last Change: 2015 Sep 25 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -115,8 +116,13 @@ function GetYAMLIndent(lnum) \ s:liststartregex)) elseif line =~# s:mapkeyregex " Same for line containing mapping key - return indent(s:FindPrevLEIndentedLineMatchingRegex(a:lnum, - \ s:mapkeyregex)) + let prevmapline = s:FindPrevLEIndentedLineMatchingRegex(a:lnum, + \ s:mapkeyregex) + if getline(prevmapline) =~# '^\s*- ' + return indent(prevmapline) + 2 + else + return indent(prevmapline) + endif elseif prevline =~# '^\s*- ' " - List with " multiline scalar |