summaryrefslogtreecommitdiffstats
path: root/runtime/indent
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-24 13:18:38 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-24 13:18:38 +0000
commitfa3b72348d88343390fbe212cfc230fec1602fc2 (patch)
treec0f27c44f2819613a4288bfc6ebc5c58f421d90d /runtime/indent
parentd3f00f54bf955bd01767db3a0af25866bc112ec7 (diff)
Update runtime files
Diffstat (limited to 'runtime/indent')
-rw-r--r--runtime/indent/sh.vim2
-rw-r--r--runtime/indent/xml.vim8
2 files changed, 8 insertions, 2 deletions
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index d2fb1ba452..aa47c6d1bd 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -109,7 +109,7 @@ function! GetShIndent()
let ind += s:indent_value('continuation-line')
endif
elseif s:end_block(line) && !s:start_block(line)
- let ind -= s:indent_value('default')
+ let ind = indent(lnum)
elseif pnum != 0 &&
\ s:is_continuation_line(pline) &&
\ !s:end_block(curline) &&
diff --git a/runtime/indent/xml.vim b/runtime/indent/xml.vim
index da65417939..5bf53ad1f8 100644
--- a/runtime/indent/xml.vim
+++ b/runtime/indent/xml.vim
@@ -39,6 +39,8 @@ setlocal indentkeys=o,O,*<Return>,<>>,<<>,/,{,},!^F
" autoindent: used when the indentexpr returns -1
setlocal autoindent
+let b:undo_indent = "setl ai< inde< indk<"
+
if !exists('b:xml_indent_open')
let b:xml_indent_open = '.\{-}<[:A-Z_a-z]'
" pre tag, e.g. <address>
@@ -51,6 +53,10 @@ if !exists('b:xml_indent_close')
" let b:xml_indent_close = '.\{-}</\(address\)\@!'
endif
+if !exists('b:xml_indent_continuation_filetype')
+ let b:xml_indent_continuation_filetype = 'xml'
+endif
+
let &cpo = s:keepcpo
unlet s:keepcpo
@@ -162,7 +168,7 @@ endfun
func! <SID>IsXMLContinuation(line)
" Checks, whether or not the line matches a start-of-tag
- return a:line !~ '^\s*<' && &ft is# 'xml'
+ return a:line !~ '^\s*<' && &ft =~# b:xml_indent_continuation_filetype
endfunc
func! <SID>HasNoTagEnd(line)