Skip to content

Commit 164c692

Browse files
ambvjohnslavik
andauthored
Apply suggestions from code review
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent 1e79b00 commit 164c692

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

Lib/_pyrepl/commands.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ def do(self) -> None:
464464

465465
with self.reader.suspend():
466466
self.reader.msg = _sitebuiltins._Helper()() # type: ignore[assignment]
467-
467+
self.reader.invalidate_prompt()
468+
468469

469470
class invalid_key(Command):
470471
def do(self) -> None:

Lib/_pyrepl/reader.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,33 +194,33 @@ def buffer_rebuild_from_pos(self) -> int | None:
194194
return 0
195195
return self.buffer_from_pos
196196

197-
def with_cursor(self) -> RefreshInvalidation:
197+
def with_cursor(self) -> Self:
198198
if self.needs_screen_refresh:
199199
return self
200200
return replace(self, cursor_only=True)
201201

202-
def with_buffer(self, from_pos: int) -> RefreshInvalidation:
202+
def with_buffer(self, from_pos: int) -> Self:
203203
current = from_pos
204204
if self.buffer_from_pos is not None:
205205
current = min(current, self.buffer_from_pos)
206206
return replace(self, cursor_only=False, buffer_from_pos=current)
207207

208-
def with_prompt(self) -> RefreshInvalidation:
208+
def with_prompt(self) -> Self:
209209
return replace(self, cursor_only=False, prompt=True)
210210

211-
def with_layout(self) -> RefreshInvalidation:
211+
def with_layout(self) -> Self:
212212
return replace(self, cursor_only=False, layout=True)
213213

214-
def with_theme(self) -> RefreshInvalidation:
214+
def with_theme(self) -> Self:
215215
return replace(self, cursor_only=False, theme=True)
216216

217-
def with_message(self) -> RefreshInvalidation:
217+
def with_message(self) -> Self:
218218
return replace(self, cursor_only=False, message=True)
219219

220-
def with_overlay(self) -> RefreshInvalidation:
220+
def with_overlay(self) -> Self:
221221
return replace(self, cursor_only=False, overlay=True)
222222

223-
def with_full(self) -> RefreshInvalidation:
223+
def with_full(self) -> Self:
224224
return replace(self, cursor_only=False, full=True)
225225

226226

0 commit comments

Comments
 (0)