File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -281,17 +281,21 @@ function! s:indent_like_previous_line(lnum)
281281 return -1
282282 endif
283283
284- " If this line is dedented and the number of indent spaces is valid
285- " (multiple of the indentation size), trust the user
286- let dedent_size = current - base
287- if dedent_size < 0 && current % s: sw () == 0
284+ if s: is_dedented_already (current, base)
288285 return -1
289286 endif
290287
291288 " In all other cases, line up with the start of the previous statement.
292289 return base
293290endfunction
294291
292+ " If this line is dedented and the number of indent spaces is valid
293+ " (multiple of the indentation size), trust the user.
294+ function ! s: is_dedented_already (current, base)
295+ let dedent_size = a: current - a: base
296+ return (dedent_size < 0 && a: current % s: sw () == 0 ) ? 1 : 0
297+ endfunction
298+
295299" Is the syntax at lnum (and optionally cnum) a python string?
296300function ! s: is_python_string (lnum, ... )
297301 let line = getline (a: lnum )
You can’t perform that action at this time.
0 commit comments