Skip to content

Commit df0131d

Browse files
fix delete key
--HG-- branch : scroll-frontend
1 parent 18a630d commit df0131d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bpython/scrollfrontend/manual_readline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def backspace(cursor_offset, line):
7979
if cursor_offset == 0:
8080
return cursor_offset, line
8181
if not line[:cursor_offset].strip(): #if just whitespace left of cursor
82-
front_white = len(line[:cursor_offset]) - len(line[:cursor_offset].lstrip())
83-
to_delete = ((front_white - 1) % INDENT) + 1
84-
return cursor_offset - to_delete, line[:to_delete] + line[cursor_offset:]
82+
#front_white = len(line[:cursor_offset]) - len(line[:cursor_offset].lstrip())
83+
to_delete = ((cursor_offset - 1) % INDENT) + 1
84+
return cursor_offset - to_delete, line[:cursor_offset - to_delete] + line[cursor_offset:]
8585
return (cursor_offset - 1,
8686
line[:cursor_offset - 1] + line[cursor_offset:])
8787

0 commit comments

Comments
 (0)