Skip to content

Commit 972dedf

Browse files
authored
Merge pull request #1936 from Textualize/opti-table
optimization for measure
2 parents b67d7aa + 429c6d3 commit 972dedf

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## Unreleased
8+
## [11.2.0] - 2022-02-08
99

1010
### Added
1111

1212
- Add support for US spelling of "gray" in ANSI color names https://github.com/Textualize/rich/issues/1890
1313
- Added `rich.diagnose.report` to expose environment debugging logic as function https://github.com/Textualize/rich/pull/1917
1414
- Added classmethod `Progress.get_default_columns()` to get the default list of progress bar columns https://github.com/Textualize/rich/pull/1894
1515

16+
### Fixed
17+
18+
- Fixed performance issue in measuring text
19+
1620
## [11.1.0] - 2022-01-28
1721

1822
### Added
1923

20-
2124
- Workaround for edge case of object from Faiss with no `__class__` https://github.com/Textualize/rich/issues/1838
2225
- Add Traditional Chinese readme
2326
- Add `Syntax.guess_lexer`, add support for more lexers (e.g. Django templates etc.) https://github.com/Textualize/rich/pull/1869
@@ -1627,6 +1630,7 @@ Major version bump for a breaking change to `Text.stylize signature`, which corr
16271630

16281631
- First official release, API still to be stabilized
16291632

1633+
[11.2.0]: https://github.com/willmcgugan/rich/compare/v11.1.0...v11.2.0
16301634
[11.1.0]: https://github.com/willmcgugan/rich/compare/v11.0.0...v11.1.0
16311635
[11.0.0]: https://github.com/willmcgugan/rich/compare/v10.16.1...v11.0.0
16321636
[10.16.1]: https://github.com/willmcgugan/rich/compare/v10.16.0...v10.16.1

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rich"
33
homepage = "https://github.com/willmcgugan/rich"
44
documentation = "https://rich.readthedocs.io/en/latest/"
5-
version = "11.1.0"
5+
version = "11.2.0"
66
description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal"
77
authors = ["Will McGugan <[email protected]>"]
88
license = "MIT"

rich/measure.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from operator import itemgetter
2-
from typing import Callable, Iterable, NamedTuple, Optional, TYPE_CHECKING
2+
from typing import TYPE_CHECKING, Callable, Iterable, NamedTuple, Optional
33

44
from . import errors
55
from .protocol import is_renderable, rich_cast
@@ -96,7 +96,9 @@ def get(
9696
if _max_width < 1:
9797
return Measurement(0, 0)
9898
if isinstance(renderable, str):
99-
renderable = console.render_str(renderable, markup=options.markup)
99+
renderable = console.render_str(
100+
renderable, markup=options.markup, highlight=False
101+
)
100102
renderable = rich_cast(renderable)
101103
if is_renderable(renderable):
102104
get_console_width: Optional[

0 commit comments

Comments
 (0)