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

Commit06b9400

Browse files
formatting and tests
1 parent4a43c11 commit06b9400

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

‎bpython/curtsiesfrontend/repl.py‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -547,17 +547,15 @@ def process_key_event(self, e):
547547
defget_last_word(self):
548548

549549
deflast_word(line):
550-
ifnotline:
551-
return''
552-
returnline.split().pop()
550+
returnline.split().pop()iflineelse''
553551

554552
previous_word=last_word(self.rl_history.entry)
555553
word=last_word(self.rl_history.back())
556-
line=self.current_line
557-
self._set_current_line(line[:len(line)-len(previous_word)]+word,reset_rl_history=False)
558-
559-
self._set_cursor_offset(self.cursor_offset-len(previous_word)+len(word),reset_rl_history=False)
560-
554+
line=self.current_line
555+
self._set_current_line(line[:len(line)-len(previous_word)]+word,
556+
reset_rl_history=False)
557+
self._set_cursor_offset(self.cursor_offset-len(previous_word)+len(word),
558+
reset_rl_history=False)
561559

562560
defincremental_search(self,reverse=False,include_current=False):
563561
ifself.special_mode==None:

‎bpython/test/test_curtsies_painting.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def assert_paint_ignoring_formatting(self, screen, cursor_row_col=None):
4040
ifcursor_row_colisnotNone:
4141
self.assertEqual(cursor_pos,cursor_row_col)
4242

43+
classTestCurtsiesPaintingTest(TestCurtsiesPainting):
44+
45+
deftest_history_is_cleared(self):
46+
self.assertEqual(self.repl.rl_history.entries, [''])
47+
4348
classTestCurtsiesPaintingSimple(TestCurtsiesPainting):
4449

4550
deftest_startup(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp