mirror of https://github.com/Textualize/rich.git
rename method
This commit is contained in:
parent
7e9bd93615
commit
d354d17783
|
@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- New ansi_dark and ansi_light themes
|
- New ansi_dark and ansi_light themes
|
||||||
- Added Text.append_tokens for fast appending of string + Style pairs
|
- Added Text.append_tokens for fast appending of string + Style pairs
|
||||||
|
- Added Text.remove_suffix
|
||||||
|
- Added Text.append_tokens
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -432,7 +432,7 @@ class Syntax(JupyterMixin):
|
||||||
code = textwrap.dedent(self.code) if self.dedent else self.code
|
code = textwrap.dedent(self.code) if self.dedent else self.code
|
||||||
code = code.expandtabs(self.tab_size)
|
code = code.expandtabs(self.tab_size)
|
||||||
text = self.highlight(code)
|
text = self.highlight(code)
|
||||||
text.removesuffix("\n")
|
text.remove_suffix("\n")
|
||||||
text.expand_tabs(self.tab_size)
|
text.expand_tabs(self.tab_size)
|
||||||
if not self.line_numbers:
|
if not self.line_numbers:
|
||||||
# Simple case of just rendering text
|
# Simple case of just rendering text
|
||||||
|
|
|
@ -356,7 +356,7 @@ class Text(JupyterMixin):
|
||||||
return
|
return
|
||||||
self._spans.append(Span(start, min(length, end), style))
|
self._spans.append(Span(start, min(length, end), style))
|
||||||
|
|
||||||
def removesuffix(self, suffix: str) -> None:
|
def remove_suffix(self, suffix: str) -> None:
|
||||||
"""Remove a suffix if it exists.
|
"""Remove a suffix if it exists.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
Loading…
Reference in New Issue