Skip to content

Commit 71320bb

Browse files
ericmburgesssebastinas
authored andcommitted
Add more keywords to trigger auto-deindent
1 parent ebefde8 commit 71320bb

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,9 @@ def predicted_indent(self, line):
12521252
elif (
12531253
line
12541254
and ":" not in line
1255-
and line.strip().startswith(("return", "pass", "raise", "yield"))
1255+
and line.strip().startswith(
1256+
("return", "pass", "...", "raise", "yield", "break", "continue")
1257+
)
12561258
):
12571259
indent = max(0, indent - self.config.tab_length)
12581260
logger.debug("indent we found was %s", indent)

bpython/repl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,9 @@ def next_indentation(line, tab_length) -> int:
12551255
if line.rstrip().endswith(":"):
12561256
indentation += 1
12571257
elif indentation >= 1:
1258-
if line.lstrip().startswith(("return", "pass", "raise", "yield")):
1258+
if line.lstrip().startswith(
1259+
("return", "pass", "...", "raise", "yield", "break", "continue")
1260+
):
12591261
indentation -= 1
12601262
return indentation
12611263

0 commit comments

Comments
 (0)