Skip to content

Commit ad65967

Browse files
committed
Specify max length instead of splicing
1 parent 5f86b6b commit ad65967

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ def move_screen_up(current_line_start_row):
15731573
if self.stdin.has_focus:
15741574
cursor_row, cursor_column = divmod(
15751575
wcswidth(self.current_stdouterr_line)
1576-
+ wcswidth(self.stdin.current_line[: self.stdin.cursor_offset]),
1576+
+ wcswidth(self.stdin.current_line, self.stdin.cursor_offset),
15771577
width,
15781578
)
15791579
assert cursor_row >= 0 and cursor_column >= 0, (cursor_row, cursor_column)
@@ -1597,7 +1597,7 @@ def move_screen_up(current_line_start_row):
15971597
(
15981598
wcswidth(self.current_cursor_line_without_suggestion.s)
15991599
- wcswidth(self.current_line)
1600-
+ wcswidth(self.current_line[: self.cursor_offset])
1600+
+ wcswidth(self.current_line, self.cursor_offset)
16011601
)
16021602
+ self.number_of_padding_chars_on_current_cursor_line(),
16031603
width,

0 commit comments

Comments
 (0)