You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This release brings completely re-written TIM implementation to the library. It is significantly faster (~2x for markup without macros, >10x for markup with macros) than the previous version, and it's a lot easier to maintain and improve upon.
The previous hyperlink syntax ([!link(https://example.org)]Example site[/!link]) is now deprecated in favour of a new, much simpler one:
[~https://example.org]Example site[/~]
There have also been a couple of changes to SVG exports to make them more accurate and aesthetically pleasing. We also support the inverse style for them as well!
Stop relying on visibility=hidden in SVG exports (d070724)
Removals
Remove get_applied_sequences helper function (a7d41bd)
API updates
Type
Change
Alternative
Comment
Removal
get_applied_sequences
A custom tokenization based implementation
This function was no longer used internally, and if someone needed it the new tokenizers are a much more performant and smart way to go about implementing it.
Removal
MarkupLanguage.prettify_markup
highlight_tim
Using regex-based highlighting allows the output markup to be completely identical char-by-char to the source, whereas the previous token based implementation had a tendency to change things around. It's also much less LOC and faster.
Previously hyperlinks were implemented as macros, but they were very messy under the hood. A first-class syntax for them is vastly superior.
Refactor
The role of StyledText
N/A
Previously, StyledText was meant to be barely detectable when used. It was returned in various places, but wanted to not be a thing you thought about often. Now it's on an opt-in basis, and it no longer tries to pass as a str. It's immutable, and is only meant to be generated by MarkupLanguage.group_styles or StyledText.group_styles. You can also now create them from markup, not just ANSI-coded text.
Showcase
Note that since the above image, tim-v3 went down to ~180-190 ns per parse
This discussion was created from the release v7.0.0: TIM-v3!.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This release brings completely re-written TIM implementation to the library. It is significantly faster (~2x for markup without macros, >10x for markup with macros) than the previous version, and it's a lot easier to maintain and improve upon.
The previous hyperlink syntax (
[!link(https://example.org)]Example site[/!link]
) is now deprecated in favour of a new, much simpler one:There have also been a couple of changes to SVG exports to make them more accurate and aesthetically pleasing. We also support the
inverse
style for them as well!Changelog
Additions
ignore_any
parameter toWidget.execute_binding
(68866e6)Bugfixes
InputField
handling clicks & drags started outside of it (input_field.py: IndexError: list index out of range #72, [BUG] input_field.py: AssertionError: assert self._drag_start is not None #75)CTRL_C
not killing compositor thread by making it a daemon ([BUG] Ctrl-C doesn't stop threads #78)widget.positioned_line_buffer
being duplicated before and after vertical alignment ([BUG] InputField appears two cursors when typing #70)Refactors
pyproject.toml
-based builds (Fix testing workflow dependency issue #82)visibility=hidden
in SVG exports (d070724)Removals
get_applied_sequences
helper function (a7d41bd)API updates
get_applied_sequences
MarkupLanguage.prettify_markup
highlight_tim
!link(https://example.org)
~https://example.org
syntaxStyledText
StyledText
was meant to be barely detectable when used. It was returned in various places, but wanted to not be a thing you thought about often. Now it's on an opt-in basis, and it no longer tries to pass as astr
. It's immutable, and is only meant to be generated byMarkupLanguage.group_styles
orStyledText.group_styles
. You can also now create them from markup, not just ANSI-coded text.Showcase
Note that since the above image,
tim-v3
went down to ~180-190 ns per parseThis discussion was created from the release v7.0.0: TIM-v3!.
Beta Was this translation helpful? Give feedback.
All reactions