diff options
Diffstat (limited to 'runtime/indent/yaml.vim')
-rw-r--r-- | runtime/indent/yaml.vim | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/runtime/indent/yaml.vim b/runtime/indent/yaml.vim index 1f798416ed..d732c37c05 100644 --- a/runtime/indent/yaml.vim +++ b/runtime/indent/yaml.vim @@ -2,7 +2,7 @@ " Language: YAML " Maintainer: Nikolai Pavlov <zyx.vim@gmail.com> " Last Update: Lukas Reineke -" Last Change: 2022 May 02 +" Last Change: 2022 Jun 17 " Only load this indent file when no other was loaded. if exists('b:did_indent') @@ -44,30 +44,30 @@ function s:FindPrevLEIndentedLineMatchingRegex(lnum, regex) return plilnum endfunction -let s:mapkeyregex='\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\'''. - \ '|\"%([^"\\]|\\.)*\"'. +let s:mapkeyregex = '\v^\s*\#@!\S@=%(\''%([^'']|\''\'')*\''' .. + \ '|\"%([^"\\]|\\.)*\"' .. \ '|%(%(\:\ )@!.)*)\:%(\ |$)' -let s:liststartregex='\v^\s*%(\-%(\ |$))' +let s:liststartregex = '\v^\s*%(\-%(\ |$))' let s:c_ns_anchor_char = '\v%([\n\r\uFEFF \t,[\]{}]@!\p)' -let s:c_ns_anchor_name = s:c_ns_anchor_char.'+' -let s:c_ns_anchor_property = '\v\&'.s:c_ns_anchor_name +let s:c_ns_anchor_name = s:c_ns_anchor_char .. '+' +let s:c_ns_anchor_property = '\v\&' .. s:c_ns_anchor_name let s:ns_word_char = '\v[[:alnum:]_\-]' -let s:ns_tag_char = '\v%(%\x\x|'.s:ns_word_char.'|[#/;?:@&=+$.~*''()])' -let s:c_named_tag_handle = '\v\!'.s:ns_word_char.'+\!' +let s:ns_tag_char = '\v%(%\x\x|' .. s:ns_word_char .. '|[#/;?:@&=+$.~*''()])' +let s:c_named_tag_handle = '\v\!' .. s:ns_word_char .. '+\!' let s:c_secondary_tag_handle = '\v\!\!' let s:c_primary_tag_handle = '\v\!' -let s:c_tag_handle = '\v%('.s:c_named_tag_handle. - \ '|'.s:c_secondary_tag_handle. - \ '|'.s:c_primary_tag_handle.')' -let s:c_ns_shorthand_tag = '\v'.s:c_tag_handle . s:ns_tag_char.'+' +let s:c_tag_handle = '\v%(' .. s:c_named_tag_handle. + \ '|' .. s:c_secondary_tag_handle. + \ '|' .. s:c_primary_tag_handle .. ')' +let s:c_ns_shorthand_tag = '\v' .. s:c_tag_handle .. s:ns_tag_char .. '+' let s:c_non_specific_tag = '\v\!' -let s:ns_uri_char = '\v%(%\x\x|'.s:ns_word_char.'\v|[#/;?:@&=+$,.!~*''()[\]])' -let s:c_verbatim_tag = '\v\!\<'.s:ns_uri_char.'+\>' -let s:c_ns_tag_property = '\v'.s:c_verbatim_tag. - \ '\v|'.s:c_ns_shorthand_tag. - \ '\v|'.s:c_non_specific_tag +let s:ns_uri_char = '\v%(%\x\x|' .. s:ns_word_char .. '\v|[#/;?:@&=+$,.!~*''()[\]])' +let s:c_verbatim_tag = '\v\!\<' .. s:ns_uri_char.. '+\>' +let s:c_ns_tag_property = '\v' .. s:c_verbatim_tag. + \ '\v|' .. s:c_ns_shorthand_tag. + \ '\v|' .. s:c_non_specific_tag let s:block_scalar_header = '\v[|>]%([+-]?[1-9]|[1-9]?[+-])?' @@ -142,9 +142,9 @@ function GetYAMLIndent(lnum) " - List with " multiline scalar return previndent+2 - elseif prevline =~# s:mapkeyregex . '\v\s*%(%('.s:c_ns_tag_property. - \ '\v|'.s:c_ns_anchor_property. - \ '\v|'.s:block_scalar_header. + elseif prevline =~# s:mapkeyregex .. '\v\s*%(%(' .. s:c_ns_tag_property .. + \ '\v|' .. s:c_ns_anchor_property .. + \ '\v|' .. s:block_scalar_header .. \ '\v)%(\s+|\s*%(\#.*)?$))*' " Mapping with: value " that is multiline scalar |