textual 2.0.0 support
Hi!
In [nixpkgs](https://github.com/NixOS/nixpkgs) we try to use the latest python packages, and noticed some changes need to be done to this project in order to work with [textual 2.0.0](https://github.com/Textualize/textual/releases/tag/v2.0.0):
- [NewOptionListContent](https://github.com/tconbeer/textual-textarea/blob/ab25de3531e0a00062ea8bb40f595be382a9481b/src/textual_textarea/autocomplete.py#L74) needs to be changed to `OptionListContent` (changed in https://github.com/Textualize/textual/commit/1cfd33c76e084bf1efadf2feaf932a071fffd462)
- [items](https://github.com/tconbeer/textual-textarea/blob/ab25de3531e0a00062ea8bb40f595be382a9481b/src/textual_textarea/autocomplete.py#L190) got renamed to `new_options` (changed in https://github.com/Textualize/textual/commit/1cfd33c76e084bf1efadf2feaf932a071fffd462)
- > Breaking change: Removed wrap argument from OptionList (use CSS text-wrap: nowrap; text-overflow: ellipses)
https://github.com/tconbeer/textual-textarea/blob/ab25de3531e0a00062ea8bb40f595be382a9481b/src/textual_textarea/autocomplete.py#L81
- fix newly failing test
<details><summary>test result</summary>
```console
FAILED tests/functional_tests/test_textarea.py::test_keys[keys2-select\n foo-selection2-select\n foo-expected_selection2] - AssertionError: assert Selection(start=(0, 6), end=(0, 6)) == Selection(start=(1, 0), end=(1, 0))
Differing attributes:
['start', 'end']
Drill down into differing attribute start:
start: (0, 6) != (1, 0)
At index 0 diff: 0 != 1
Full diff:
(
- 1,
0,
+ 6,
)
Drill down into differing attribute end:
end: (0, 6) != (1, 0)
At index 0 diff: 0 != 1
Full diff:
(
- 1,
0,
+ 6,
)
Full diff:
- Selection(start=(1, 0), end=(1, 0))
? ^ ^ ^ ^
+ Selection(start=(0, 6), end=(0, 6))
? ^ ^ ^ ^
```
</details>
- possibly others
1 条评论