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

407 Коммитов

Автор SHA1 Сообщение Дата
Gleb Tv
6aa9ec0b87 fix(wrap): drop phantom whitespace rows for inputs that exactly fill a row
Word-wrap previously emitted a phantom whitespace-only row when a word
exactly filled a row and the input continued (e.g. "abcde fghij" at
width 5 wrapped to 3 rows instead of 2). Separator whitespace that does
not fit the remaining space is now handled like ratatui's WordWrapper
(trim: false): whitespace filling the remaining cells is dropped,
whitespace after an exactly full row is dropped one grapheme at a time,
and any leftover whitespace leads the next row.

wrapped_rows now keeps byte-accurate column bookkeeping so screen_map
round-trips hold for all visible positions; positions inside dropped
whitespace have no screen representation and are treated as such.

Verified differentially against ratatui 0.30's WordWrapper (a faithful
reference port cross-checked against the real Paragraph renderer):
row counts now match for single- and multi-space separators, trailing
whitespace, CJK and mixed-width inputs.
2026-08-19 13:36:28 +03:00
Gleb
0b93c88729 Merge branch 'srothgan:main' into main 2026-08-19 12:25:27 +03:00
Gleb Tv
b542e179ae feat(keymap): bind Ctrl+Backspace/Ctrl+Delete to word deletion
Add the de-facto standard terminal/editor hotkeys to the default key map:
- Ctrl+Backspace -> delete_word
- Ctrl+Delete -> delete_next_word

Previously only Alt+Backspace/Ctrl+w and Alt+Delete/Alt+d were bound,
which conflicts with muscle memory from readline, VS Code and other TUIs.
2026-08-17 20:47:38 +03:00
dependabot[bot]
e298fcff3a Bump rand from 0.8.6 to 0.9.5 (#30)
Bumps [rand](https://github.com/rust-random/rand) from 0.8.6 to 0.9.5.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/0.9.5/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.6...0.9.5)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.9.5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-22 17:51:44 +02:00
dependabot[bot]
5173571337 Bump the cargo-non-major group across 2 directories with 9 updates (#29)
Bumps the cargo-non-major group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [ratatui-core](https://github.com/ratatui/ratatui) | `0.1.0` | `0.1.2` |
| [ratatui-widgets](https://github.com/ratatui/ratatui) | `0.3.0` | `0.3.2` |
| [portable-atomic](https://github.com/taiki-e/portable-atomic) | `1.13.1` | `1.14.0` |
| [regex](https://github.com/rust-lang/regex) | `1.12.3` | `1.13.1` |
| [unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation) | `1.13.2` | `1.13.3` |
| [serde](https://github.com/serde-rs/serde) | `1.0.228` | `1.0.229` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.149` | `1.0.151` |
| [ratatui](https://github.com/ratatui/ratatui) | `0.30.0` | `0.30.2` |

Bumps the cargo-non-major group with 1 update in the /fuzz directory: [libfuzzer-sys](https://github.com/rust-fuzz/libfuzzer).


Updates `ratatui-core` from 0.1.0 to 0.1.2
- [Release notes](https://github.com/ratatui/ratatui/releases)
- [Changelog](https://github.com/ratatui/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui/ratatui/compare/ratatui-core-v0.1.0...ratatui-core-v0.1.2)

Updates `ratatui-widgets` from 0.3.0 to 0.3.2
- [Release notes](https://github.com/ratatui/ratatui/releases)
- [Changelog](https://github.com/ratatui/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui/ratatui/compare/ratatui-widgets-v0.3.0...ratatui-widgets-v0.3.2)

Updates `portable-atomic` from 1.13.1 to 1.14.0
- [Release notes](https://github.com/taiki-e/portable-atomic/releases)
- [Changelog](https://github.com/taiki-e/portable-atomic/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/portable-atomic/compare/v1.13.1...v1.14.0)

Updates `regex` from 1.12.3 to 1.13.1
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.12.3...1.13.1)

Updates `unicode-segmentation` from 1.13.2 to 1.13.3
- [Commits](https://github.com/unicode-rs/unicode-segmentation/commits)

Updates `serde` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `serde_json` from 1.0.149 to 1.0.151
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.149...v1.0.151)

Updates `ratatui` from 0.30.0 to 0.30.2
- [Release notes](https://github.com/ratatui/ratatui/releases)
- [Changelog](https://github.com/ratatui/ratatui/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ratatui/ratatui/compare/ratatui-v0.30.0...ratatui-v0.30.2)

Updates `libfuzzer-sys` from 0.4.12 to 0.4.13
- [Changelog](https://github.com/rust-fuzz/libfuzzer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-fuzz/libfuzzer/compare/0.4.12...0.4.13)

---
updated-dependencies:
- dependency-name: ratatui-core
  dependency-version: 0.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
- dependency-name: ratatui-widgets
  dependency-version: 0.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
- dependency-name: portable-atomic
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-non-major
- dependency-name: regex
  dependency-version: 1.13.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-non-major
- dependency-name: unicode-segmentation
  dependency-version: 1.13.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
- dependency-name: serde
  dependency-version: 1.0.229
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
- dependency-name: serde_json
  dependency-version: 1.0.151
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
- dependency-name: ratatui
  dependency-version: 0.30.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
- dependency-name: libfuzzer-sys
  dependency-version: 0.4.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-non-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-22 17:47:49 +02:00
srothgan
32b26e80f8 chore(deps): harden dependency updates (#28) 2026-07-23 01:37:20 +10:00
srothgan
9b5afba816 chore: clean up repository labels (#27) 2026-07-10 20:19:46 +10:00
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
d6335585bc chore: prepare 0.12.0 release (#25) 2026-07-01 05:12:31 +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
56f531a73f chore: migrate to Rust 2024 edition and bump to v0.9.2 (#12)
* chore: migrate to Rust 2024 edition and bump to v0.9.2

- Bump edition to 2024 and rust-version to 1.85.0
- Replace f64::log10 with usize::ilog10 in num_digits
- Fix clippy lints surfaced by edition bump: repeat_n, derived Default, then_some
- Expand watch-check and watch-test aliases to cover all feature paths (crossterm_0_28, no-backend, tuirs variants, serde, arbitrary)
- Expand CI test and clippy workflows to full 6/8-entry feature matrices including termion on Ubuntu
- Apply rustfmt import reordering from edition 2024 rules

* fix: revert turis linux checks
2026-02-20 03:38:50 +10:00
srothgan
f169a4b18c chore(fuzz): upgrade targets, fix false positives, and add invariant assertions (#11)
- Fix insert_delete target using .unwrap() causing false-positive crashes
  on arbitrary::Error (input exhaustion)
- Fix fuzz Cargo.toml referencing wrong package name (tui-textarea vs
  tui-textarea-2)
- Add invariant assertions (cursor bounds, lines non-empty, selection
  validity) to all targets
- Add 4 new fuzz targets: undo_redo, selection, wrap_render, search
- Expand existing targets with full delete/insert variant coverage,
  input_without_shortcuts, set_yank_text, set_max_histories, and clear
- Add DummyBackend::resize() for variable-width wrap rendering tests
2026-02-19 17:44:58 +10:00
srothgan
19151a4076 chore(bench): restructure into focused targets, add runner, and tune slow cases (#10)
- Upgrade Criterion 0.5 → 0.8.2
- Split 4 broad bench files into 14 focused targets
- Add Rust runner binary with per-target start/done logging
- Add wrap_render benchmarks (all 4 WrapMode variants × 2 sizes)
- Add undo_redo benchmarks (undo/redo × 3 history depths)
- Apply benchmark_group + SamplingMode::Flat + reduced sample_size on slow insert cases to cut total run time from ~28 min to ~12 min
- Rewrite bench/README.md to document runner, targets, and workflow
2026-02-19 09:22:09 +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
cc783097ae docs(readme): replace CI badge with Rust Test and Rust Clippy badges (#7) 2026-02-19 00:22:51 +10:00
srothgan
1395c65183 chore/refactor-ci-workflows (#6)
* ci(workflows): split CI into focused workflows and add Codecov upload

* ci(coverage): upload to codecov for same-repo PRs and main pushes

* fix(ci): upload coverage to codecov only on main pushes
2026-02-19 00:14:17 +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
srothgan
b82ae1a9d6 ci(release): use single auto release workflow on main (#4) 2026-02-18 22:11:52 +10:00
srothgan
b361f74b06 chore: rename crate to tui-textarea-2 and update metadata/docs links (#2)
* chore: rename crate to tui-textarea-2 and update metadata/docs links

* chore: prepare v0.7.1 publish for tui-textarea-2

* ci(release): automate publish, tag, and release after merge to main
2026-02-18 21:39:59 +10:00
srothgan
4689076df5 chore: ratatui 0.30 maintenance + collaboration baseline (#1) 2026-02-18 11:46:03 +01:00
rhysd
4d18622eea do not use RUSTDOCFLAGS environment variable for checking document generation
because it is used by all the dependencies and some package will break
due to the flags in the variable.
2024-12-01 18:15:58 +09:00
rhysd
ad518def02 prefer eliding lifetimes 2024-12-01 15:12:50 +09:00
rhysd
7f2722256d update changelog for v0.7.0 changes 2024-10-23 01:28:45 +09:00
rhysd
f2de5ff1ef bump up version to v0.7.0 2024-10-23 01:24:26 +09:00
rhysd
e56b6e0da4 update fuzz deps and fix warnings in fuzz targets 2024-10-23 01:20:27 +09:00
Alessandro Ricottone
413c4f62da Update Ratatui to 0.29.0 (#86)
Co-authored-by: Josh McKinney <joshka@users.noreply.github.com>
2024-10-23 01:08:06 +09:00
rhysd
2cae64bae6 do not depend on implicit features
since it is warned on building this crate in Rust 2024
2024-08-15 12:35:11 +09:00
rhysd
b8491704bc improve description of feature gates in readme document 2024-08-12 22:29:08 +09:00
rhysd
d4342dceef update changelog for v0.6.1 changes 2024-08-09 01:04:23 +09:00
rhysd
a0b820cf7d bump up version to v0.6.1 2024-08-09 00:44:22 +09:00
rhysd
49c90f0983 fix tests for termion support when using old version of termion 2024-08-08 23:55:25 +09:00
rhysd
3fb0a78a4c use the same version of termion as tui's dependency for tuirs-termion feature 2024-08-08 23:04:13 +09:00
rhysd
8d2c201aff add tests for TextArea::selection_range 2024-08-08 22:40:15 +09:00
rhysd
de736a584f make the first element of range is smaller than the second one (#81) 2024-08-08 20:55:35 +09:00
Linda_pp
b7a7e3dc34 Merge pull request #81 from achristmascarl/expose-selection-start
Expose `selection_start`
2024-08-08 09:25:35 +09:00
achristmascarl
75f51111e1 switch to selection range 2024-08-07 16:34:13 -04:00
rhysd
93cfabdc69 update changelog for v0.6.0 changes 2024-08-08 00:34:30 +09:00
rhysd
7a8c020d4e bump up version to v0.6.0 2024-08-08 00:26:11 +09:00
rhysd
9b86d54a67 fix fuzzing test cases to follow ratatui v0.28 2024-08-08 00:25:28 +09:00
rhysd
abc2b7d4e2 fix deprecated node version warning from codecov/codecov-action@v3 2024-08-08 00:14:57 +09:00
rhysd
9650a1171a fix warnings and compile errors due to ratatui v0.28 update 2024-08-08 00:12:17 +09:00
rhysd
5d77bf8a9a update ratatui dependency from 0.27 to 0.28 2024-08-07 23:55:24 +09:00
achristmascarl
31012c6a01 fix tests 2024-08-06 12:45:18 -04:00
achristmascarl
23dfde75bd expose selection_start 2024-08-06 12:33:10 -04:00