Skip to content

Commit a365af7

Browse files
committed
Version 6.0.0
1 parent 48b785f commit a365af7

File tree

4 files changed

+47
-10
lines changed

4 files changed

+47
-10
lines changed

CHANGELOG.md

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,49 @@
1+
## [6.0.0] - 2022-05-12
2+
3+
### Removals
4+
- **Remove `Window.allow_fullscreen`, `Window.toggle_fullscreen`**
5+
6+
7+
### Refactors
8+
- **Add new, customizable window blur styles**
9+
- **Rename all builtin aliases to follow the `domain.item` naming scheme**
10+
- Implement a new, much faster and `\n` supporting `break_line` function
11+
- Improve animation stability
12+
- Start caching `real_length`, `strip_markup` & `strip_ansi` results
13+
- Refactor `StyledText` to only tokenize on-demand
14+
- Rewrite the pattern used to match markup to improve how escapes are handled
15+
- Introduce new, layout based CLI with an RGB colorpicker & inspector
16+
17+
18+
### Additions
19+
- Add `Collapsible` widget (114da3a3d769d6abd72a8727ed036b1e947c0a23)
20+
- Add new `highlighters` module with `RegexHighlighter` class
21+
- Add `is_scroll, `is_primary` & `is_secondary` helpers to MouseEvent`
22+
- Add `Terminal.no_record` context
23+
- Add `WindowManager.alert` and `WindowManager.float` methods
24+
- Add layout `assign` parameter to `WindowManager.add`
25+
- Add window manager `Layout` class
26+
27+
28+
### Bugfixes
29+
- Fix overly greedy optimization in `MarkupLanguage.parse` getting rid of important unsetters
30+
- Fix `/` not being handled properly in various places
31+
32+
33+
134
## [5.0.0] - 2022-04-19
235

3-
## Refactors
36+
### Refactors
437
- **Refactor `window_manager.py` into 3 files under `window_manager` submodule**
538
- **Refactor the entire animation system**
639
- Move scrolling behaviour into new `ScrollableWidget` class
740
- Improve `Terminal` API
841
- Rename `widgets/layouts``widgets/containers`
942

1043

11-
## Additions
12-
- Add `StyleManager.__call__` method that sets the given **kwargs keys and values
13-
- Add (currently unused) `Widget.get\_change` helper
44+
### Additions
45+
- Add `StyleManager.__call__` method that sets the given \**kwargs keys and values
46+
- Add (currently unused) `Widget.get_change` helper
1447

1548

1649

@@ -22,7 +55,7 @@
2255

2356

2457
### Additions
25-
- Add `getch_timeout` method (49ff24445329e6f3581c1cf34c5265225ef765bd)
58+
- Add `getch_timeout` method
2659

2760

2861

@@ -35,7 +68,6 @@
3568

3669

3770

38-
3971
## [4.3.0] - 2022-04-02
4072

4173
### Additions
@@ -123,6 +155,8 @@
123155

124156

125157

158+
[6.0.0]: https://github.com/bczsalba/pytermgui/compare/5.0.0...6.0.0
159+
[5.0.0]: https://github.com/bczsalba/pytermgui/compare/4.3.2...5.0.0
126160
[4.3.2]: https://github.com/bczsalba/pytermgui/compare/4.3.1...4.3.2
127161
[4.3.1]: https://github.com/bczsalba/pytermgui/compare/4.3.0...4.3.1
128162
[4.3.0]: https://github.com/bczsalba/pytermgui/compare/4.2.0...4.3.0

pytermgui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
warnings.filterwarnings("ignore")
4343

44-
__version__ = "5.0.0"
44+
__version__ = "6.0.0"
4545

4646

4747
def auto(data: Any, **widget_args: Any) -> Optional[Widget | list[Splitter]]:

pytermgui/helpers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ def break_line(
105105

106106
if token.sequence == "\x1b[0m":
107107
sequences = "\x1b[0m"
108-
current += sequences
108+
109+
if len(current) > 0:
110+
current += sequences
111+
109112
continue
110113

111114
sequences += token.sequence
@@ -114,7 +117,7 @@ def break_line(
114117
if current == "":
115118
return
116119

117-
if sequences != "":
120+
if sequences != "" and not current.endswith("\x1b[0m"):
118121
current += "\x1b[0m"
119122

120123
yield current

tests/test_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def test_break_fancy():
1515
"\x1b[38;5;141m\x1b[1mHel\x1b[0m",
1616
"\x1b[38;5;141m\x1b[1mlo \x1b[0m",
1717
"\x1b[38;5;141m\x1b[1mthe\x1b[0m",
18-
"\x1b[38;5;141m\x1b[1mre\x1b[3m\x1b[38;5;4m \x1b[0m",
18+
"\x1b[38;5;141m\x1b[1mre\x1b[0m\x1b[3m\x1b[38;5;4m \x1b[0m",
1919
"\x1b[0m\x1b[3m\x1b[38;5;4mwha\x1b[0m",
2020
"\x1b[0m\x1b[3m\x1b[38;5;4mts \x1b[0m",
2121
"\x1b[0m\x1b[3m\x1b[38;5;4mup\x1b[38;5;6m\x1b[1m?\x1b[0m",

0 commit comments

Comments
 (0)