Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 253581e

Browse files
committed
Ctrl-W word splitting on ., (, and =
1 parent da9706b commit 253581e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

bipython/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,14 @@ def keypress(self, size, key):
447447
p = len(line[:self.edit_pos].strip())
448448
line = line[:p] + line[self.edit_pos:]
449449
# delete a full word
450-
np = line.rfind(' ', 0, p)
450+
# XXX: fugly word splitting heuristics, but better than just
451+
# slitting on space
452+
np = max(
453+
line.rfind(' ', 0, p),
454+
line.rfind('.', 0, p),
455+
line.rfind('(', 0, p),
456+
line.rfind('=', 0, p)
457+
)
451458
if np == -1:
452459
line = line[p:]
453460
np = 0

0 commit comments

Comments
 (0)