Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb66a00

Browse files
committed
Ensure that passed length is non-negative
1 parentb1082cf commitcb66a00

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎bpython/curtsiesfrontend/repl.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,9 @@ def move_screen_up(current_line_start_row):
15731573
ifself.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(
1577+
self.stdin.current_line,max(0,self.stdin.cursor_offset)
1578+
),
15771579
width,
15781580
)
15791581
assertcursor_row>=0andcursor_column>=0, (
@@ -1600,7 +1602,7 @@ def move_screen_up(current_line_start_row):
16001602
(
16011603
wcswidth(self.current_cursor_line_without_suggestion.s)
16021604
-wcswidth(self.current_line)
1603-
+wcswidth(self.current_line,self.cursor_offset)
1605+
+wcswidth(self.current_line,max(0,self.cursor_offset))
16041606
)
16051607
+self.number_of_padding_chars_on_current_cursor_line(),
16061608
width,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp