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

chore: refresh GitHub repository setup (#23)

* chore: refresh GitHub repository setup

* chore: align CI with Rust 1.88 MSRV
Этот коммит содержится в:
srothgan
2026-06-30 20:47:43 +02:00
коммит произвёл GitHub
родитель 9c4db800ef
Коммит ebd3af05e1
21 изменённых файлов: 209 добавлений и 46 удалений

1
.github/CODEOWNERS поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1 @@
* @srothgan

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

@@ -2,7 +2,7 @@
name: Compatibility request name: Compatibility request
about: Request compatibility with ratatui/crossterm/etc. about: Request compatibility with ratatui/crossterm/etc.
title: "[compat] " title: "[compat] "
labels: ["compat-ratatui"] labels: ["enhancement"]
assignees: [] assignees: []
--- ---

4
.github/branch-protection-main.json поставляемый
Просмотреть файл

@@ -3,12 +3,12 @@
"strict": true, "strict": true,
"contexts": [ "contexts": [
"cargo fmt --check", "cargo fmt --check",
"cargo clippy -- -D warnings", "cargo clippy --all-targets -- -D warnings",
"cargo check", "cargo check",
"cargo test" "cargo test"
] ]
}, },
"enforce_admins": true, "enforce_admins": false,
"required_pull_request_reviews": { "required_pull_request_reviews": {
"dismiss_stale_reviews": true, "dismiss_stale_reviews": true,
"required_approving_review_count": 1, "required_approving_review_count": 1,

9
.github/dependabot.yml поставляемый
Просмотреть файл

@@ -1,9 +1,14 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: cargo - package-ecosystem: cargo
directory: "/" directories:
- "/"
- "/bench"
- "/fuzz"
schedule: schedule:
interval: weekly interval: weekly
labels:
- dependencies
open-pull-requests-limit: 10 open-pull-requests-limit: 10
groups: groups:
patch-and-minor: patch-and-minor:
@@ -14,3 +19,5 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: weekly interval: weekly
labels:
- dependencies

9
.github/workflows/check.yml поставляемый
Просмотреть файл

@@ -6,12 +6,15 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
cargo-check: cargo-check:
name: cargo check name: cargo check
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- run: cargo check - run: cargo check

9
.github/workflows/clippy.yml поставляемый
Просмотреть файл

@@ -6,14 +6,17 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
cargo-clippy: cargo-clippy:
name: cargo clippy --all-targets -- -D warnings name: cargo clippy --all-targets -- -D warnings
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
with: with:
components: clippy components: clippy
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- run: cargo clippy --all-targets -- -D warnings - run: cargo clippy --all-targets -- -D warnings

11
.github/workflows/coverage.yml поставляемый
Просмотреть файл

@@ -6,20 +6,23 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
coverage: coverage:
name: cargo llvm-cov + codecov name: cargo llvm-cov + codecov
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
with: with:
components: llvm-tools-preview components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- uses: taiki-e/install-action@cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov --workspace --all-targets --lcov --output-path lcov.info - run: cargo llvm-cov --workspace --all-targets --lcov --output-path lcov.info
- name: Upload coverage reports to Codecov - name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5 uses: codecov/codecov-action@v7
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}

9
.github/workflows/cross-platform.yml поставляемый
Просмотреть файл

@@ -6,6 +6,9 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
cross-platform: cross-platform:
name: cross-platform default (${{ matrix.os }}) name: cross-platform default (${{ matrix.os }})
@@ -17,8 +20,8 @@ jobs:
- ubuntu-latest - ubuntu-latest
- windows-latest - windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- run: cargo check - run: cargo check
- run: cargo test - run: cargo test

9
.github/workflows/fmt.yml поставляемый
Просмотреть файл

@@ -6,14 +6,17 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
cargo-fmt: cargo-fmt:
name: cargo fmt --check name: cargo fmt --check
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
with: with:
components: rustfmt components: rustfmt
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- run: cargo fmt --check - run: cargo fmt --check

16
.github/workflows/release.yml поставляемый
Просмотреть файл

@@ -13,6 +13,7 @@ on:
permissions: permissions:
contents: write contents: write
id-token: write
concurrency: concurrency:
group: release-main group: release-main
@@ -23,13 +24,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: release environment: release
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- name: Read version and tag - name: Read version and tag
id: meta id: meta
@@ -65,11 +66,16 @@ jobs:
cargo package cargo package
cargo test cargo test
- name: Authenticate with crates.io
if: steps.tag.outputs.exists == 'false'
id: auth
uses: rust-lang/crates-io-auth-action@v1
- name: Publish to crates.io - name: Publish to crates.io
if: steps.tag.outputs.exists == 'false' if: steps.tag.outputs.exists == 'false'
env: env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish --locked --token "$CARGO_REGISTRY_TOKEN" run: cargo publish --locked
- name: Create and push tag - name: Create and push tag
if: steps.tag.outputs.exists == 'false' if: steps.tag.outputs.exists == 'false'

9
.github/workflows/test.yml поставляемый
Просмотреть файл

@@ -6,12 +6,15 @@ on:
branches: branches:
- main - main
permissions:
contents: read
jobs: jobs:
cargo-test: cargo-test:
name: cargo test name: cargo test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable - uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2.9.1
- run: cargo test - run: cargo test

90
CODE_OF_CONDUCT.md Обычный файл
Просмотреть файл

@@ -0,0 +1,90 @@
# Contributor Covenant 3.0 Code of Conduct
## Our Pledge
We pledge to make our community welcoming, safe, and equitable for all.
We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
## Encouraged Behaviors
While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
2. Engaging **kindly and honestly** with others.
3. Respecting **different viewpoints** and experiences.
4. **Taking responsibility** for our actions and contributions.
5. Gracefully giving and accepting **constructive feedback**.
6. Committing to **repairing harm** when it occurs.
7. Behaving in other ways that promote and sustain the **well-being of our community**.
## Restricted Behaviors
We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
3. **Stereotyping or discrimination.** Characterizing anyones personality or behavior on the basis of immutable identities or traits.
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
7. Behaving in other ways that **threaten the well-being** of our community.
### Other Restrictions
1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
## Reporting an Issue
Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
When an incident does occur, it is important to report it promptly. To report a possible violation, **use [GitHub Security Advisories](https://github.com/srothgan/claude-code-rust/security/advisories/new) or contact the project maintainer, Simon Rothgang, at simonrothgang@icloud.com.**
Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
## Addressing and Repairing Harm
If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
1) Warning
1) Event: A violation involving a single incident or series of incidents.
2) Consequence: A private, written warning from the Community Moderators.
3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
2) Temporarily Limited Activities
1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
3) Temporary Suspension
1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
4) Permanent Ban
1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
3) Repair: There is no possible repair in cases of this severity.
This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
## Scope
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozillas code of conduct team](https://github.com/mozilla/inclusion).

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

@@ -5,7 +5,7 @@ repository = "https://github.com/srothgan/tui-textarea"
documentation = "https://docs.rs/tui-textarea-2/latest/tui_textarea/" documentation = "https://docs.rs/tui-textarea-2/latest/tui_textarea/"
version = "0.11.0" version = "0.11.0"
edition = "2024" edition = "2024"
rust-version = "1.85.0" # for Rust 2024 edition support rust-version = "1.88.0" # for Ratatui 0.30 split crates
authors = ["Simon Peter Rothgang <simonrothgang@icloud.com>", "rhysd <lin90162@yahoo.co.jp>"] authors = ["Simon Peter Rothgang <simonrothgang@icloud.com>", "rhysd <lin90162@yahoo.co.jp>"]
description = """ description = """
tui-textarea is a simple yet powerful text editor widget for ratatui. Multi-line tui-textarea is a simple yet powerful text editor widget for ratatui. Multi-line

42
SECURITY.md Обычный файл
Просмотреть файл

@@ -0,0 +1,42 @@
# Security Policy
## Supported Versions
| Version | Supported |
|---------|-----------|
| latest | Yes |
| < latest | No (upgrade to latest) |
## Reporting a Vulnerability
**Please do NOT report security vulnerabilities through public GitHub issues.**
Instead, use [GitHub Security Advisories](https://github.com/srothgan/tui-textarea/security/advisories/new)
to report vulnerabilities privately.
Please include:
1. Description of the vulnerability
2. Steps to reproduce
3. Potential impact
4. Suggested fix, if any
## Response Timeline
- **Acknowledgment**: Within 48 hours
- **Initial assessment**: Within 1 week
- **Fix and disclosure**: Coordinated with reporter, typically within 30 days
## Scope
This policy covers the `tui-textarea-2` crate and vulnerabilities in its integration
with supported terminal backends and optional features. Vulnerabilities in upstream
libraries such as Ratatui, Crossterm, Termion, or Termwiz should be reported to
their respective maintainers unless the issue is caused by this crate's usage or
integration of those libraries.
## Security Measures
- Dependency updates are managed via Dependabot
- Dependabot security alerts and security updates are enabled
- All PRs require CI checks for test, clippy, fmt, and MSRV compatibility

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

@@ -19,7 +19,7 @@ fn validate(textarea: &mut TextArea) -> bool {
Block::default() Block::default()
.borders(Borders::ALL) .borders(Borders::ALL)
.border_style(Color::LightRed) .border_style(Color::LightRed)
.title(format!("ERROR: {}", err)), .title(format!("ERROR: {err}")),
); );
false false
} else { } else {

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

@@ -31,7 +31,7 @@ impl Mode {
Self::Visual => "type y to yank, type d to delete, type Esc to back to normal mode", Self::Visual => "type y to yank, type d to delete, type Esc to back to normal mode",
Self::Operator(_) => "move cursor to apply operator", Self::Operator(_) => "move cursor to apply operator",
}; };
let title = format!("{} MODE ({})", self, help); let title = format!("{self} MODE ({help})");
Block::default().borders(Borders::ALL).title(title) Block::default().borders(Borders::ALL).title(title)
} }
@@ -52,7 +52,7 @@ impl fmt::Display for Mode {
Self::Normal => write!(f, "NORMAL"), Self::Normal => write!(f, "NORMAL"),
Self::Insert => write!(f, "INSERT"), Self::Insert => write!(f, "INSERT"),
Self::Visual => write!(f, "VISUAL"), Self::Visual => write!(f, "VISUAL"),
Self::Operator(c) => write!(f, "OPERATOR({})", c), Self::Operator(c) => write!(f, "OPERATOR({c})"),
} }
} }
} }

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

@@ -322,7 +322,7 @@ mod tests {
b.width = offset; b.width = offset;
let built = b.build(text); let built = b.build(text);
let want = offset + built.as_ref().width(); let want = offset + built.as_ref().width();
assert_eq!(b.width, want, "in={:?}, out={:?}", text, built); // Check post condition assert_eq!(b.width, want, "in={text:?}, out={built:?}"); // Check post condition
built built
} }

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

@@ -29,7 +29,7 @@ impl EditKind {
lines.insert(before.row + 1, next_line); lines.insert(before.row + 1, next_line);
} }
EditKind::DeleteNewline => { EditKind::DeleteNewline => {
debug_assert!(before.row > 0, "invalid pos: {:?}", before); debug_assert!(before.row > 0, "invalid pos: {before:?}");
let line = lines.remove(before.row); let line = lines.remove(before.row);
lines[before.row - 1].push_str(&line); lines[before.row - 1].push_str(&line);
} }
@@ -40,7 +40,7 @@ impl EditKind {
lines[after.row].drain(after.offset..after.offset + s.len()); lines[after.row].drain(after.offset..after.offset + s.len());
} }
EditKind::InsertChunk(c) => { EditKind::InsertChunk(c) => {
debug_assert!(c.len() > 1, "Chunk size must be > 1: {:?}", c); debug_assert!(c.len() > 1, "Chunk size must be > 1: {c:?}");
// Handle first line of chunk // Handle first line of chunk
let first_line = &mut lines[before.row]; let first_line = &mut lines[before.row];
@@ -56,7 +56,7 @@ impl EditKind {
lines.splice(next_row..next_row, c[1..c.len() - 1].iter().cloned()); lines.splice(next_row..next_row, c[1..c.len() - 1].iter().cloned());
} }
EditKind::DeleteChunk(c) => { EditKind::DeleteChunk(c) => {
debug_assert!(c.len() > 1, "Chunk size must be > 1: {:?}", c); debug_assert!(c.len() > 1, "Chunk size must be > 1: {c:?}");
// Remove middle lines of chunk // Remove middle lines of chunk
let mut last_line = lines let mut last_line = lines

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

@@ -147,7 +147,7 @@ mod tests {
input(Key::Null, true, false, false), input(Key::Null, true, false, false),
), ),
] { ] {
assert_eq!(Input::from(from), to, "{:?} -> {:?}", from, to); assert_eq!(Input::from(from), to, "{from:?} -> {to:?}");
} }
} }
@@ -182,7 +182,7 @@ mod tests {
input(Key::Null, true, false, false), input(Key::Null, true, false, false),
), ),
] { ] {
assert_eq!(Input::from(from), to, "{:?} -> {:?}", from, to); assert_eq!(Input::from(from), to, "{from:?} -> {to:?}");
} }
} }
@@ -202,7 +202,7 @@ mod tests {
), ),
(Event::FocusGained, input(Key::Null, false, false, false)), (Event::FocusGained, input(Key::Null, false, false, false)),
] { ] {
assert_eq!(Input::from(from.clone()), to, "{:?} -> {:?}", from, to); assert_eq!(Input::from(from.clone()), to, "{from:?} -> {to:?}");
} }
} }
@@ -212,6 +212,6 @@ mod tests {
let mut from = key_event(KeyCode::Char('a'), KeyModifiers::empty()); let mut from = key_event(KeyCode::Char('a'), KeyModifiers::empty());
from.kind = KeyEventKind::Release; from.kind = KeyEventKind::Release;
let to = input(Key::Null, false, false, false); let to = input(Key::Null, false, false, false);
assert_eq!(Input::from(from), to, "{:?} -> {:?}", from, to); assert_eq!(Input::from(from), to, "{from:?} -> {to:?}");
} }
} }

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

@@ -53,7 +53,7 @@ impl From<Vec<String>> for YankText {
impl fmt::Display for YankText { impl fmt::Display for YankText {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::Piece(s) => write!(f, "{}", s), Self::Piece(s) => write!(f, "{s}"),
Self::Chunk(ss) => write!(f, "{}", ss.join("\n")), Self::Chunk(ss) => write!(f, "{}", ss.join("\n")),
} }
} }
@@ -763,7 +763,7 @@ impl<'a> TextArea<'a> {
}; };
// Check invariants // Check invariants
debug_assert!(!self.lines.is_empty(), "no line after {:?}", input); debug_assert!(!self.lines.is_empty(), "no line after {input:?}");
let DataCursor(r, c) = self.cursor; let DataCursor(r, c) = self.cursor;
debug_assert!( debug_assert!(
self.lines.len() > r, self.lines.len() > r,
@@ -1070,7 +1070,7 @@ impl<'a> TextArea<'a> {
} }
fn insert_chunk(&mut self, chunk: Vec<String>) -> bool { fn insert_chunk(&mut self, chunk: Vec<String>) -> bool {
debug_assert!(chunk.len() > 1, "Chunk size must be > 1: {:?}", chunk); debug_assert!(chunk.len() > 1, "Chunk size must be > 1: {chunk:?}");
self.normalize_cursor_around_atomic_ranges(AtomicCursorBias::Forward); self.normalize_cursor_around_atomic_ranges(AtomicCursorBias::Forward);
let DataCursor(row, col) = self.cursor; let DataCursor(row, col) = self.cursor;
@@ -1107,8 +1107,7 @@ impl<'a> TextArea<'a> {
let line = &mut self.lines[row]; let line = &mut self.lines[row];
debug_assert!( debug_assert!(
!s.contains('\n'), !s.contains('\n'),
"string given to TextArea::insert_piece must not contain newline: {:?}", "string given to TextArea::insert_piece must not contain newline: {line:?}",
line,
); );
let i = line let i = line

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

@@ -25,7 +25,7 @@ fn empty_textarea() {
Jump(u16::MAX, u16::MAX), Jump(u16::MAX, u16::MAX),
] { ] {
t.move_cursor(m); t.move_cursor(m);
assert_eq!(t.cursor(), (0, 0), "{:?}", m); assert_eq!(t.cursor(), (0, 0), "{m:?}");
} }
} }