Mercurial > vim
diff runtime/indent/yaml.vim @ 7147:c590de398af9
commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 25 20:34:21 2015 +0200
Update various runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 25 Sep 2015 20:45:09 +0200 |
parents | b3f3237a3d72 |
children | 873eae260c97 |
line wrap: on
line diff
--- 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