-
Notifications
You must be signed in to change notification settings - Fork 243
Conversation
|
||
errors = list[str]() | ||
while self.edits: | ||
error = self.undo() | ||
if error: | ||
errors.append(error) | ||
return "\n".join(errors) | ||
errors += error |
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.
Should this still be .append
(since it's a list)?
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.
error is also a list
if (isinstance(line, str) and line.strip()) or ( | ||
isinstance(line, Tuple) and line[0].strip() |
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.
Is line.strip()
in the if statement just checking if the line is empty or not? Might be more readable to do line == ""
or line != ""
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.
We want to make sure it has stuff other than just whitespace; otherwise I would just do if line
|
||
from mentat.session_context import SESSION_CONTEXT | ||
|
||
FormattedString = str | Tuple[str, Dict[str, Any]] | List[Tuple[str, Dict[str, Any]]] |
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.
Might be better to make FormattedString
an actual class instead of a union of all these types.
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.
Maybe; I'll add a TODO but I want to get this PR merged quickly because I need it in order to work on my textual PR.
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.
Left a few comments/suggestions, otherwise LGTM
Removes all uses of colored and highlight so that all coloring is handled entirely by the client (which is necessary for the Textual client). Ideally we eventually move completely over to styles instead of colors, but this is a step in that direction.
Pull Request Checklist