Skip to content

Commit 836bb87

Browse files
afriedersebastinas
authored andcommitted
Fix option-backspace behavior
1 parent 307f855 commit 836bb87

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bpython/curtsiesfrontend/manual_readline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def titlecase_next_word(cursor_offset, line):
323323
return cursor_offset, line # TODO Not implemented
324324

325325

326-
delete_word_from_cursor_back_re = LazyReCompile(r'\b\w')
326+
delete_word_from_cursor_back_re = LazyReCompile(r'^|\b\w')
327327

328328

329329
@edit_keys.on('<Esc+BACKSPACE>')

bpython/test/test_manual_readline.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,12 @@ def test_delete_word_from_cursor_back(self):
240240
"|"],
241241
delete_word_from_cursor_back)
242242

243+
self.try_stages_kill([
244+
" (( asdf |",
245+
" (( |",
246+
"|"],
247+
delete_word_from_cursor_back)
248+
243249

244250
class TestEdits(unittest.TestCase):
245251

0 commit comments

Comments
 (0)