Skip to content

Commit 882c1f3

Browse files
committed
consistent return for delete_word_from_cursor_back
bpython would crash when option-backspace on empty line
1 parent 9def303 commit 882c1f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpython/curtsiesfrontend/manual_readline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def titlecase_next_word(cursor_offset, line):
268268
def delete_word_from_cursor_back(cursor_offset, line):
269269
"""Whatever my option-delete does in bash on my mac"""
270270
if not line:
271-
return cursor_offset, line
271+
return cursor_offset, line, ''
272272
starts = [m.start() for m in list(re.finditer(r'\b\w', line)) if m.start() < cursor_offset]
273273
if starts:
274274
return starts[-1], line[:starts[-1]] + line[cursor_offset:], line[starts[-1]:cursor_offset]

0 commit comments

Comments
 (0)