1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-08 08:25:51 +03:00

feat: set lines measure cache (#16)

* feat(textarea): add bulk replace API and transparent measure() caching

- add TextArea::set_lines(lines, cursor) for direct whole-buffer replacement
- preserve widget configuration while resetting history, selection, highlights, viewport scroll, and cached measurement state
- cache measure(width_cols) results by outer width and reuse them until dependencies change
- invalidate cached measurement on content edits, undo/redo, and measure-affecting setters
- add focused tests for set_lines behavior and cache correctness

* chore(release): bump to v0.10.2 and refresh docs

- prepare the v0.10.2 release with updated crate version and changelog entry
- refresh README coverage for fork-added APIs including wrapping, measurement, bulk replace, and custom highlights
Этот коммит содержится в:
srothgan
2026-03-13 11:58:29 +01:00
коммит произвёл GitHub
родитель cb6c431908
Коммит f20df6b965
6 изменённых файлов: 453 добавлений и 7 удалений

Просмотреть файл

@@ -1,3 +1,13 @@
<a id="v0.10.2"></a>
# [v0.10.2](https://github.com/srothgan/tui-textarea/releases/tag/v0.10.2) - 2026-03-13
- Add `TextArea::set_lines(lines, cursor)` for direct whole-buffer replacement without rebuilding widget configuration.
- Preserve textarea configuration across `set_lines()` while resetting history, active selection, custom highlights, viewport scroll, and cached measurement state.
- Cache `TextArea::measure(width_cols)` results by width and invalidate the cache on content edits, `undo()` / `redo()`, and measure-affecting setters.
- Add tests covering `set_lines()` semantics, cursor clamping, and `measure()` cache correctness.
[Changes][v0.10.2]
<a id="v0.10.1"></a>
# [v0.10.1](https://github.com/srothgan/tui-textarea/releases/tag/v0.10.1) - 2026-03-05
@@ -516,6 +526,7 @@ First release :tada:
[Changes][v0.1.0]
[v0.10.2]: https://github.com/srothgan/tui-textarea/compare/v0.10.1...v0.10.2
[v0.10.1]: https://github.com/srothgan/tui-textarea/compare/v0.10.0...v0.10.1
[v0.10.0]: https://github.com/srothgan/tui-textarea/compare/v0.9.2...v0.10.0
[v0.9.2]: https://github.com/srothgan/tui-textarea/compare/v0.9.1...v0.9.2