1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-08-28 11:36:17 +03:00

41 Коммитов

Автор SHA1 Сообщение Дата
srothgan
475f0beb82 feat(textarea): add native cursor render mode (#26)
* feat(textarea): add native cursor render mode

- Add CursorRenderMode::{Cell, Hidden} and TextArea accessors for render mode plus rendered_cursor_position().
- Store the terminal-relative cursor position from a shared render plan that accounts for blocks, line numbers, scroll, wrapping, tabs, and wide Unicode.
- Let hidden mode suppress only the textarea-owned cursor cell while preserving default Cell rendering and set_cursor_style behavior.
- Document native cursor integration and add focused tests for default rendering, hidden rendering, placeholders, and cursor-position edge cases.

* chore: prepare 0.12.1 release
2026-07-10 20:14:27 +10:00
srothgan
ebd3af05e1 chore: refresh GitHub repository setup (#23)
* chore: refresh GitHub repository setup

* chore: align CI with Rust 1.88 MSRV
2026-07-01 04:47:43 +10:00
srothgan
9c4db800ef feat(textarea): add atomic range editing support (#19)
- add public AtomicRange API with validation and diagnostic errors
- make cursor movement, deletion, insertion, selection, undo/redo, and set_lines atom-aware
- clear caller-derived atomic ranges after successful content mutations
- add focused atomic range tests plus serde coverage
- document atomic ranges and add a caller-owned parsing example
2026-07-01 04:17:20 +10:00
srothgan
8f708cfdc7 feat: add screen/data cursor maps for wrapped movement (#17)
* feat!: remove tui-rs support and map screen cursors

* docs(examples): add fixed-size recording mode

* chore(release): bump to v0.11.0
2026-05-03 16:48:05 +10:00
srothgan
f20df6b965 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
2026-03-13 20:58:29 +10:00
srothgan
cb6c431908 feat: wrapped line cursor navigation (#15)
* feat(cursor): add Up/Down navigation between wrapped visual lines

- Extend CursorMove::next_cursor() with optional wrapped rows parameter so Up/Down use visual row indices when wrapping is active
- Compute wrapped rows in move_cursor_with_shift() and pass them through
- Fix cursor_at_visual_row() boundary clamping for non-last wrapped segments to prevent the cursor landing on the next visual line
- Preserve visual column offset when moving between wrapped rows so the cursor moves straight vertically instead of jumping to row start/end

* chore(release): bump to v0.10.1 and update changelog
2026-03-06 04:15:19 +10:00
srothgan
1a64a949b6 Feat/textarea row measurement min max (#14)
* feat(textarea): add row measurement API with configurable min/max bounds

- add TextAreaMeasure and TextArea::measure(width_cols)
- make measurement wrap-aware and include block chrome rows
- add set_min_rows/set_max_rows (+ getters) with invariant normalization
- clamp preferred_rows to effective [min_rows, max_rows]
- export TextAreaMeasure at crate root
- switch examples/variable.rs to measured preferred_rows
- add integration tests for measure + min/max behavior

* chore(release): bump to v0.10.0 and update changelog
2026-02-26 01:00:26 +10:00
srothgan
f03a7b9ec1 fix(textarea): clamp undo/redo cursor after oversized delete_str (#9) 2026-02-19 07:37:00 +10:00
srothgan
1740facd24 feat: add unicode-aware soft-wrap modes and wrapped rendering (#8)
* feat(textarea): add unicode-aware soft-wrap modes and wrapped rendering

- add WrapMode API/state: None, Word, Glyph, WordOrGlyph
- keep None behavior unchanged (horizontal scroll)
- implement wrapped render path with logical-to-visual row mapping
- add Unicode-aware wrapping via unicode-segmentation + unicode-width
- make wrap width tab-aware to prevent hidden text
- apply cursor-line style on wrapped continuation rows
- fix selection at soft-wrap boundaries (no synthetic highlighted space)
- add wrap-focused tests for long text, newlines, tabs, tiny widths, and line-number
    continuations

* chore(release): bump to v0.9.0 and update README/CHANGELOG
2026-02-19 03:26:48 +10:00
srothgan
43afdc5ce1 chore/integrate-open-prs (#5)
* docs: integrate upstream PR #116

* feat: integrate upstream PR #113

* chore: add portable-atomic for viewport atomics (upstream PR #111)

* fix(examples): integrate upstream PR #100

* fix(word): integrate upstream PR #98

* fix(widget): handle wide unicode char widths in horizontal scroll (upstream PR #94)

* feat(highlight): integrate upstream PR #93

* chore(release): prepare v0.8.0 docs and CI-clean merged upstream updates

* docs(license): rename LICENSE.txt to LICENSE and fix header capitalization
2026-02-18 23:34:50 +10:00
rhysd
ad518def02 prefer eliding lifetimes 2024-12-01 15:12:50 +09:00
rhysd
8d2c201aff add tests for TextArea::selection_range 2024-08-08 22:40:15 +09:00
rhysd
150ee9d360 add more tests for search feature 2024-08-05 00:02:11 +09:00
rhysd
474b5f372a add tests for search feature 2024-08-04 23:36:33 +09:00
rhysd
e5500dfa61 fix typos 2024-08-02 23:07:17 +09:00
rhysd
d6e0b76268 add more tests for CursorMove::WordEnd 2024-08-01 02:01:39 +09:00
achristmascarl
d016971a5f update tests, examples, readme 2024-07-30 15:09:03 -04:00
rhysd
673bdcb84b add tests for serde support 2024-07-12 23:36:45 +09:00
rhysd
9e3df38b54 fix inser_str doesn't handle \r\n and ignores newline at end of input 2023-11-19 22:08:25 +09:00
rhysd
1194331a02 fix TextArea::set_yank_text doesn't support CRLF (\r\n) for newline 2023-11-18 18:28:32 +09:00
rhysd
13ce6aa6d5 fix selected text is not deleted on paste 2023-11-15 01:57:48 +09:00
rhysd
8e3a432ecc add Key::Copy, Key::Cut, Key::Paste support 2023-11-15 01:29:44 +09:00
rhysd
523a888f26 implement TextArea::select_all
but it is not assigned to default key shortcuts because C-a is already
in use.
2023-11-15 00:11:18 +09:00
rhysd
9d03463237 test positions after undo/redo 2023-11-13 20:32:15 +09:00
rhysd
bae9d4cee3 refactor undo/redo implementation 2023-11-13 19:29:43 +09:00
rhysd
cb868a19b6 add sanity test for all combination of key inputs 2023-11-13 00:19:17 +09:00
rhysd
f0370e850c add more tests for deleting text 2023-11-12 23:06:25 +09:00
rhysd
a54ce36d22 refactor text selection and add more tests (fix #6) 2023-11-12 18:22:17 +09:00
pm100
5a2649abe9 implement select (#45)
* select, second go using new multiline code

* implemented internal delete_str, added tests

* delete_str_internal must not put non deleted strings into history. Ie ctrlc should not change history

* delete_str was taking lines out in the non delete case

* corrected comment

* fixes after feedback. Plus multichar bugs. change modal sample
2023-11-10 21:10:04 +09:00
rhysd
a7731be860 add tests for multi-bytes characters 2023-11-03 02:31:27 +09:00
rhysd
1283081f82 keep yanked lines in Vec 2023-11-02 22:54:28 +09:00
rhysd
9db8a3d31a test TextArea::undo after insert_str and delete_str 2023-11-02 21:08:21 +09:00
rhysd
b324ccd9fd allow TextArea::delete_str to delete across newlines 2023-11-02 21:01:27 +09:00
rhysd
8bc9ff4dba add tests for TextArea::insert_str 2023-11-01 21:32:15 +09:00
rhysd
68275e4932 consider wide chars on calculating tab width 2023-10-21 00:30:36 +09:00
rhysd
ce5dc54cd4 add regression test case for #4 2022-10-04 17:58:18 +09:00
rhysd
8097183e75 add tests for CursorMove::Top and CursorMove::Bottom 2022-07-20 15:50:00 +09:00
rhysd
851db5eadb add CursorMove tests for multi-byte characters 2022-07-19 18:49:13 +09:00
rhysd
a7206db6f9 add tests for CursorMove::Head and CursorMove::End 2022-07-19 18:00:04 +09:00
rhysd
0341a4beaa add tests for CursorMove::Up and CursorMove::Down 2022-07-19 14:36:29 +09:00
rhysd
025ce6b187 add tests for CursorMove::Forward and CursorMove::Back 2022-07-14 22:57:31 +09:00