-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-148228: Enable error overlays in the REPL #148229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
86977f9
9415f6b
62b3577
50188d3
c4b55f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -288,6 +288,7 @@ class Reader: | |
| ps3: str = "|.. " | ||
| ps4: str = R"\__ " | ||
| kill_ring: list[list[str]] = field(default_factory=list) | ||
| error_prefix: str = "! " | ||
| msg: str = "" | ||
| arg: int | None = None | ||
| finished: bool = False | ||
|
|
@@ -875,9 +876,13 @@ def finish(self) -> None: | |
| pass | ||
|
|
||
| def error(self, msg: str = "none") -> None: | ||
| self.msg = "! " + msg + " " | ||
| self.invalidate_message() | ||
| error_prefix = self.error_prefix | ||
| if self.can_colorize: | ||
| t = THEME() | ||
| error_prefix = f"{t.error}{error_prefix}{t.reset}" | ||
| self.console.beep() | ||
| self.msg = error_prefix + msg | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I am misreading this flow but if I am not wrong, the |
||
| self.invalidate_message() | ||
|
|
||
| def update_screen(self) -> None: | ||
| if self.invalidation.is_cursor_only: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have tests that cover both branches here?