File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ function! s:IsContinuedLine(lnum)
99 return getline (a: lnum - 1 ) = ~ ' \v\\$'
1010endfunction
1111
12+ function ! s: IsInSubstitution (lnum)
13+ " Returns "true" if the given line is a continued line.
14+ return getline (a: lnum - 1 ) = ~ ' \v\($'
15+ endfunction
16+
1217function ! s: FindPrevLnum (lnum)
1318 " Starting on the given line, search backwards for a line that is not
1419 " empty, not part of a string and not a continued line.
@@ -80,6 +85,14 @@ function! fish#Indent()
8085 return l: previndent + l: shiftwidth
8186 endif
8287 endif
88+ if l: prevline = ~ ' (\s*$'
89+ " Inside a substitution
90+ let l: shift += 1
91+ endif
92+ if l: line = ~ ' ^\s*)'
93+ " Outside a substitution
94+ let l: shift -= 1
95+ endif
8396 if l: prevline = ~# ' \v^\s*%(begin|if|else|while|for|function|case|switch)>'
8497 " First line inside a block, increase by one.
8598 let l: shift += 1
You can’t perform that action at this time.
0 commit comments