X Tutup
Skip to content

Commit 8132696

Browse files
committed
Merge dedent branch into main
2 parents e84b077 + a8ebb09 commit 8132696

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bpython/repl.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,9 @@ def next_indentation(line, tab_length):
10211021
indentation = (len(line) - len(line.lstrip(' '))) // tab_length
10221022
if line.rstrip().endswith(':'):
10231023
indentation += 1
1024+
elif indentation >= 1:
1025+
if line.lstrip().startswith(('return', 'pass', 'raise', 'yield')):
1026+
indentation -= 1
10241027
return indentation
10251028

10261029

0 commit comments

Comments
 (0)
X Tutup