From 8f708cfdc7b96d04002cf968081b598792155354 Mon Sep 17 00:00:00 2001
From: srothgan <141313976+srothgan@users.noreply.github.com>
Date: Sun, 3 May 2026 08:48:05 +0200
Subject: [PATCH] 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
---
CHANGELOG.md | 12 ++
Cargo.toml | 24 +--
README.md | 57 ++----
bench/src/lib.rs | 3 +-
examples/RECORDING.md | 53 +++++
examples/common/mod.rs | 65 ++++++
examples/editor.rs | 8 +
examples/minimal.rs | 4 +
examples/password.rs | 4 +
examples/popup_placeholder.rs | 4 +
examples/single_line.rs | 4 +
examples/split.rs | 4 +
examples/tuirs_editor.rs | 365 ----------------------------------
examples/tuirs_minimal.rs | 52 -----
examples/tuirs_termion.rs | 73 -------
examples/variable.rs | 4 +
examples/vim.rs | 4 +
src/cursor.rs | 221 +++++++++++++-------
src/highlight.rs | 9 +-
src/input/mod.rs | 15 +-
src/input/termion.rs | 29 ---
src/lib.rs | 13 +-
src/screen_map.rs | 285 ++++++++++++++++++++++++++
src/scroll.rs | 1 -
src/textarea.rs | 193 ++++++++----------
src/widget.rs | 91 ++-------
src/wrap.rs | 54 -----
tests/wrap.rs | 56 +++++-
28 files changed, 782 insertions(+), 925 deletions(-)
create mode 100644 examples/RECORDING.md
create mode 100644 examples/common/mod.rs
delete mode 100644 examples/tuirs_editor.rs
delete mode 100644 examples/tuirs_minimal.rs
delete mode 100644 examples/tuirs_termion.rs
create mode 100644 src/screen_map.rs
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c582fb4..fc60c25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+
+# [v0.11.0](https://github.com/srothgan/tui-textarea/releases/tag/v0.11.0) - 2026-05-03
+
+- **BREAKING:** Remove legacy `tui-rs` feature support and the `tuirs-*` examples; this fork now supports ratatui integrations only.
+- Add a screen/data cursor mapping layer to preserve visual columns correctly across wrapped rows containing tabs or wide Unicode characters.
+- Rework wrapped cursor movement and rendering to use the cached screen map shared by the widget and cursor logic.
+- Add regression tests for wrapped cursor movement across mixed-width text.
+- Add an opt-in fixed-size recording mode for crossterm examples via `TUI_TEXTAREA_RECORDING` and `TUI_TEXTAREA_RECORDING_SIZE`.
+
+[Changes][v0.11.0]
+
# [v0.10.2](https://github.com/srothgan/tui-textarea/releases/tag/v0.10.2) - 2026-03-13
@@ -526,6 +537,7 @@ First release :tada:
[Changes][v0.1.0]
+[v0.11.0]: https://github.com/srothgan/tui-textarea/compare/v0.10.2...v0.11.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
diff --git a/Cargo.toml b/Cargo.toml
index b4f677a..3ab95c7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,12 +3,12 @@ name = "tui-textarea-2"
homepage = "https://github.com/srothgan/tui-textarea#readme"
repository = "https://github.com/srothgan/tui-textarea"
documentation = "https://docs.rs/tui-textarea-2/latest/tui_textarea/"
-version = "0.10.2"
+version = "0.11.0"
edition = "2024"
rust-version = "1.85.0" # for Rust 2024 edition support
authors = ["Simon Peter Rothgang ", "rhysd "]
description = """
-tui-textarea is a simple yet powerful text editor widget for ratatui and tui-rs. Multi-line
+tui-textarea is a simple yet powerful text editor widget for ratatui. Multi-line
text editor can be easily put as part of your TUI application.
"""
license = "MIT"
@@ -29,11 +29,6 @@ crossterm_0_28 = ["ratatui", "dep:crossterm-028"]
termion = ["ratatui", "dep:termion"]
termwiz = ["ratatui", "dep:termwiz"]
no-backend = ["ratatui"]
-# Features to use tui-rs
-tuirs = ["dep:tui"]
-tuirs-crossterm = ["tuirs", "dep:crossterm-025", "tui/crossterm"]
-tuirs-termion = ["tuirs", "dep:termion-15", "tui/termion"]
-tuirs-no-backend = ["tuirs"]
# Other optional features
search = ["dep:regex"]
serde = ["dep:serde"]
@@ -43,15 +38,12 @@ arbitrary = ["dep:arbitrary"]
arbitrary = { version = "1", features = ["derive"], optional = true }
crossterm = { package = "crossterm", version = "0.29", optional = true }
crossterm-028 = { package = "crossterm", version = "0.28", optional = true }
-crossterm-025 = { package = "crossterm", version = "0.25", optional = true }
ratatui-core = { version = "0.1.0", default-features = false, optional = true }
ratatui-widgets = { version = "0.3.0", default-features = false, optional = true }
portable-atomic = "1.11.1"
regex = { version = "1", optional = true }
termion = { version = "4.0", optional = true }
-termion-15 = { package = "termion", version = "1.5", optional = true }
termwiz = { version = "0.23.0", optional = true }
-tui = { version = "0.19", default-features = false, optional = true }
unicode-width = "0.2.0"
unicode-segmentation = "1.10.1"
serde = { version = "1", optional = true , features = ["derive"] }
@@ -96,18 +88,6 @@ required-features = ["termwiz"]
name = "termion"
required-features = ["termion"]
-[[example]]
-name = "tuirs_minimal"
-required-features = ["tuirs-crossterm"]
-
-[[example]]
-name = "tuirs_editor"
-required-features = ["tuirs-crossterm", "search"]
-
-[[example]]
-name = "tuirs_termion"
-required-features = ["tuirs-termion"]
-
[workspace]
members = ["bench"]
diff --git a/README.md b/README.md
index 16aff2c..cd6c241 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ tui-textarea-2
[![Rust Clippy][clippy-badge]][clippy]
[![coverage][codecov-badge]][codecov]
-[tui-textarea-2][crate] is a simple yet powerful text editor widget like