Update runtime files.
Includes changing &sw to shiftwidth() for all indent scripts.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: YAML
|
||||
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
|
||||
" Last Change: 2015 Nov 01
|
||||
" Last Change: 2017 Jun 13
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@ -24,14 +24,6 @@ if exists('*GetYAMLIndent')
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('*shiftwidth')
|
||||
let s:shiftwidth = function('shiftwidth')
|
||||
else
|
||||
function s:shiftwidth()
|
||||
return &shiftwidth
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function s:FindPrevLessIndentedLine(lnum, ...)
|
||||
let prevlnum = prevnonblank(a:lnum-1)
|
||||
let curindent = a:0 ? a:1 : indent(a:lnum)
|
||||
@ -119,7 +111,7 @@ function GetYAMLIndent(lnum)
|
||||
"
|
||||
" - |-
|
||||
" Block scalar without indentation indicator
|
||||
return previndent+s:shiftwidth()
|
||||
return previndent+shiftwidth()
|
||||
elseif prevline =~# '\v[:-]\ [|>]%(\d+[+\-]?|[+\-]?\d+)%(\#.*|\s*)$'
|
||||
" - |+2
|
||||
" block scalar with indentation indicator
|
||||
@ -155,7 +147,7 @@ function GetYAMLIndent(lnum)
|
||||
\ '\v)%(\s+|\s*%(\#.*)?$))*'
|
||||
" Mapping with: value
|
||||
" that is multiline scalar
|
||||
return previndent+s:shiftwidth()
|
||||
return previndent+shiftwidth()
|
||||
endif
|
||||
return previndent
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user