1010let b: did_indent = 1
1111
1212setlocal indentexpr = GetVimIndent ()
13- setlocal indentkeys += = end ,= else ,= cat ,= fina ,= END,0 \\
13+ setlocal indentkeys += = end ,= else ,= cat ,= fina ,= END,0 \\ , 0 = \" \\ \
1414
1515let b: undo_indent = " setl indentkeys< indentexpr<"
1616
@@ -31,15 +31,17 @@ function GetVimIndent()
3131 endtry
3232endfunc
3333
34+ let s: lineContPat = ' ^\s*\(\\\|"\\ \)'
35+
3436function GetVimIndentIntern ()
3537 " Find a non-blank line above the current line.
3638 let lnum = prevnonblank (v: lnum - 1 )
3739
38- " If the current line doesn't start with '\' and below a line that starts
39- " with '\', use the indent of the line above it.
40+ " If the current line doesn't start with '\' or '"\ ' and below a line that
41+ " starts with '\' or '"\ ', use the indent of the line above it.
4042 let cur_text = getline (v: lnum )
41- if cur_text !~ ' ^\s*\\ '
42- while lnum > 0 && getline (lnum) = ~ ' ^\s*\\ '
43+ if cur_text !~ s: lineContPat
44+ while lnum > 0 && getline (lnum) = ~ s: lineContPat
4345 let lnum = lnum - 1
4446 endwhile
4547 endif
@@ -51,10 +53,10 @@ function GetVimIndentIntern()
5153 let prev_text = getline (lnum)
5254
5355 " Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
54- " and :else. Add it three times for a line that starts with '\' after
55- " a line that doesn't (or g:vim_indent_cont if it exists).
56+ " and :else. Add it three times for a line that starts with '\' or '"\ '
57+ " after a line that doesn't (or g:vim_indent_cont if it exists).
5658 let ind = indent (lnum)
57- if cur_text = ~ ' ^\s*\\ ' && v: lnum > 1 && prev_text !~ ' ^\s*\\ '
59+ if cur_text = ~ s: lineContPat && v: lnum > 1 && prev_text !~ s: lineContPat
5860 if exists (" g:vim_indent_cont" )
5961 let ind = ind + g: vim_indent_cont
6062 else
0 commit comments