Skip to content

Commit 9bb338c

Browse files
committed
Fix python indent issue
1 parent 297c0df commit 9bb338c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

autoload/sj/python.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ endfunction
317317
function! sj#python#JoinTernaryAssignment()
318318
let include_syntax = sj#IncludeSyntax(['pythonConditional'])
319319
let start_lineno = line('.')
320+
let indent = indent('.')
320321
normal! 0
321322

322323
if sj#SearchSkip('^\s*\zsif\>', include_syntax, 'Wc', line('.')) <= 0
@@ -356,6 +357,7 @@ function! sj#python#JoinTernaryAssignment()
356357

357358
let body = lhs_if_true . ' ' . body_if_true . ' ' . if_clause . ' else ' . body_if_false
358359
call sj#ReplaceLines(start_lineno, start_lineno + 3, body)
360+
call sj#SetIndent(start_lineno, start_lineno, indent)
359361

360362
return 1
361363
endfunction

0 commit comments

Comments
 (0)