Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ What follows is how TuiCode implements it today.
## Multiple cursors and undo (#106)

- `Alt+Up`/`Alt+Down` move, and `Alt+Shift+Up`/`Alt+Shift+Down` duplicate, the lines under every cursor or selection (`EditorTextView.MoveLines`/`DuplicateLines`). As in VS Code, a selection that ends at column 0 leaves that last line out, and adjacent cursors' lines move as one block. `Ctrl+Alt+Up`/`Ctrl+Alt+Down` add a cursor above/below every cursor, keeping the column across shorter lines. `Alt+Click` adds or removes a cursor, and a plain click or `Esc` goes back to one. `Esc` is `ClearSelection` (#362), `Editor`-scoped and enabled only with extra cursors or a selection: one press drops both, leaving the primary cursor where it is. `RemoveSecondaryCursors` keeps its command, with no key. The find bar's layer sits above it, so Esc closes find first. These are workbench commands like any other, so they act on the active tab whatever has focus, then focus the editor.
- **Carets.** The primary caret is TG's own insertion point and selection. The others are `Caret`s in `EditorTextView._secondary` (`EditorTextView.Carets.cs`). A key at several carets (`AtEachCaret`) loads each caret into TG's private fields in turn, last in the buffer first, and runs TG's own command there, so TG's movement and editing semantics all carry over. A caret already visited is held as its distance from the end of the buffer, which edits before it don't change. Carets that meet afterwards merge. Only the commands in `CaretCommands` run at every caret. Copy, cut and paste are our own (paste spreads the clipboard one line per caret when the counts match). Copy and cut at one caret go through the same path, `VerifiedClipboard.Write`, which reads the clipboard back to check the text arrived; `IClipboard.IsSupported` is false on macOS while the clipboard works, so it isn't consulted. A cut the clipboard refused deletes nothing, and the workbench reports either outcome in the status bar (#318). When the read-back doesn't match, `ClipboardTools` copies again through the platform's own program (`pbcopy`, `wl-copy`/`xclip`, `clip.exe`) and reads that back too (#319). `pbcopy` and `pbpaste` run with `LC_ALL=en_US.UTF-8`: in any other locale they garble non-ASCII text on the way in and undo it on the way out, so the read-back can't catch it (#347); tests swap `EditorTextView.ClipboardFallback` for one over a fake `IProcessRunner`, so none spawns a real process. `WorkbenchHost` wraps the driver's clipboard in `TerminalClipboard`, which also sends every copy as OSC 52, text fields' included, so over SSH it reaches the clipboard of the machine the terminal runs on (#443). The status bar adds `through the terminal` only when nothing else took the text. TG's clipboard on Linux is an in-process `FakeClipboard`, so `VerifiedClipboard` doesn't count it as the platform's and tries `wl-copy`/`xclip` too. Copies over 750 KB aren't sent: tmux drops a sequence over 1 MiB. TG 2.1.0's `TextView.OnKeyDown` reads `SelectedLength`, which rebuilds the selection by repeated string concatenation, so every key after select-all on a large file took minutes; `EditorTextView.OnKeyDown` calls it only while autocomplete has suggestions, which is never, since TuiCode doesn't use autocomplete. Anything else, such as select-all, first drops back to the primary caret. A terminal draws only one cursor, and anything we paint fills a whole cell, so in terminals that support kitty's [multiple cursors protocol](https://sw.kovidgoyal.net/kitty/multiple-cursors-protocol/) (kitty 0.43+), `TerminalCursors` has the terminal draw the focused editor's secondary carets in the main cursor's shape. `WorkbenchHost` queries support at startup (`QueueAnsiRequest`; a terminal that doesn't answer is dropped after a second). After each `LayoutAndDrawComplete` (i.e. after the frame is flushed) it sends their screen cells, only when they've changed. It clears them when focus leaves the editor: they aren't tied to the main cursor's visibility, so they'd otherwise show through dialogs. Elsewhere, and while that query is outstanding, `EditorTextView` hides the terminal cursor and paints every caret, the primary included, as a block: the character it sits before, in the editable colours reversed (#223). A painted bar (`▏`) would fill the cell and hide that character (#401). Only carets a terminal can't draw are painted, and a single caret anywhere, the editor's or a dialog's, is left to the terminal cursor. The cursor style comes back once there's a single caret. Cursor moves while visiting carets aren't reported to `EditorTab.CursorMoved`, so navigation history sees only the primary caret.
- **Carets.** The primary caret is TG's own insertion point and selection. The others are `Caret`s in `EditorTextView._secondary` (`EditorTextView.Carets.cs`). A key at several carets (`AtEachCaret`) loads each caret into TG's private fields in turn, last in the buffer first, and runs TG's own command there, so TG's movement and editing semantics all carry over. A caret already visited is held as its distance from the end of the buffer, which edits before it don't change. Carets that meet afterwards merge. Only the commands in `CaretCommands` run at every caret. Copy, cut and paste are our own (paste spreads the clipboard one line per caret when the counts match). The terminal's own paste arrives as a bracketed paste, which TG sends the focused view as `Command.Paste` with no key, so `EditorTextView.OnPaste` puts it through the same paste, as one undo step (#446). Copy and cut at one caret go through the same path, `VerifiedClipboard.Write`, which reads the clipboard back to check the text arrived; `IClipboard.IsSupported` is false on macOS while the clipboard works, so it isn't consulted. A cut the clipboard refused deletes nothing, and the workbench reports either outcome in the status bar (#318). When the read-back doesn't match, `ClipboardTools` copies again through the platform's own program (`pbcopy`, `wl-copy`/`xclip`, `clip.exe`) and reads that back too (#319). `pbcopy` and `pbpaste` run with `LC_ALL=en_US.UTF-8`: in any other locale they garble non-ASCII text on the way in and undo it on the way out, so the read-back can't catch it (#347); tests swap `EditorTextView.ClipboardFallback` for one over a fake `IProcessRunner`, so none spawns a real process. `WorkbenchHost` wraps the driver's clipboard in `TerminalClipboard`, which also sends every copy as OSC 52, text fields' included, so over SSH it reaches the clipboard of the machine the terminal runs on (#443). The status bar adds `through the terminal` only when nothing else took the text. TG's clipboard on Linux is an in-process `FakeClipboard`, so `VerifiedClipboard` doesn't count it as the platform's and tries `wl-copy`/`xclip` too. Copies over 750 KB aren't sent: tmux drops a sequence over 1 MiB. TG 2.1.0's `TextView.OnKeyDown` reads `SelectedLength`, which rebuilds the selection by repeated string concatenation, so every key after select-all on a large file took minutes; `EditorTextView.OnKeyDown` calls it only while autocomplete has suggestions, which is never, since TuiCode doesn't use autocomplete. Anything else, such as select-all, first drops back to the primary caret. A terminal draws only one cursor, and anything we paint fills a whole cell, so in terminals that support kitty's [multiple cursors protocol](https://sw.kovidgoyal.net/kitty/multiple-cursors-protocol/) (kitty 0.43+), `TerminalCursors` has the terminal draw the focused editor's secondary carets in the main cursor's shape. `WorkbenchHost` queries support at startup (`QueueAnsiRequest`; a terminal that doesn't answer is dropped after a second). After each `LayoutAndDrawComplete` (i.e. after the frame is flushed) it sends their screen cells, only when they've changed. It clears them when focus leaves the editor: they aren't tied to the main cursor's visibility, so they'd otherwise show through dialogs. Elsewhere, and while that query is outstanding, `EditorTextView` hides the terminal cursor and paints every caret, the primary included, as a block: the character it sits before, in the editable colours reversed (#223). A painted bar (`▏`) would fill the cell and hide that character (#401). Only carets a terminal can't draw are painted, and a single caret anywhere, the editor's or a dialog's, is left to the terminal cursor. The cursor style comes back once there's a single caret. Cursor moves while visiting carets aren't reported to `EditorTab.CursorMoved`, so navigation history sees only the primary caret.
- **Undo is ours, not TG's** (`EditorTextView.History.cs`). TG 2.1.0's history can't hold an edit at several carets as one step. It also mis-undoes its own kill commands and edits over a selection, and interleaving undo with new edits corrupts it. Every edit is diffed (`LineDiff.Hunks`) against `_recorded`, a copy of the lines as of the last recorded edit, and pushed as one `EditGroup` with the carets before and after. Undo and redo splice those lines back and restore every caret and selection. TG's own history is cleared after each record, and `Undo`/`Redo` (the commands and the methods, via `new`) are ours. Edits reach the recorder through `Edit` (several carets, line moves), `EditAtPrimary` (a key, or `EditorTab.Replace`), or `OnContentsChanged` as a catch-all for anything else TG edits. The diff scans the whole buffer, costing ~0.2 ms per typed character at 50,000 lines (`EditorTypingBenchmarkTests`).
- **Selecting occurrences (#113)**: `sno`/`spo`/`sao` (`EditorTextView.Occurrences.cs`) have no default keys. From a caret with no selection, they first select the word (letters, digits, `_`) or whitespace run at every caret; after that, occurrences of that text match only whole words or whole whitespace runs. Starting from a selection matches it anywhere, even across lines. Matching is case-sensitive, and the pure `Occurrences` class does it over graphemes, so columns are cells. Next/previous skip text that's already selected, wrap around the buffer, and make the new selection the primary caret so it scrolls into view. Select all replaces every caret, keeping the primary's selection as the primary.
- TG 2.1.0's kill commands ignore a selection and then throw reading it, even with one cursor. `InvokeEditCommands` deletes the selection instead, as VS Code does.
Expand Down
15 changes: 12 additions & 3 deletions src/TuiCode.Editor/EditorTextView.Carets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
switch (commands)
{
case [Command.Paste]:
PasteAtCarets();
PasteAtCarets(App?.Clipboard?.GetClipboardData());
return true;
case [Command.NextTabStop]:
return IndentLines();
Expand Down Expand Up @@ -288,9 +288,18 @@
return true;
}

private void PasteAtCarets()
// The terminal's own paste arrives here as a bracketed paste, through Command.Paste rather than a key.
protected override bool OnPaste(string text)
{
if (ReadOnly || App?.Clipboard?.GetClipboardData() is not { Length: > 0 } text) return;
if (_holdContentsChanged) return base.OnPaste(text);
if (HasSecondaryCarets) PasteAtCarets(text);
else EditAtPrimary(() => base.OnPaste(text));
return true;
}

private void PasteAtCarets(string? text)
{
if (ReadOnly || text is not { Length: > 0 }) return;
var carets = Carets;
var pieces = text == _copiedText && _copiedPieces.Length == carets.Length ? _copiedPieces : Split(text);
if (pieces.Length != carets.Length) pieces = [.. carets.Select(_ => text)];
Expand Down Expand Up @@ -490,29 +499,29 @@
}

[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_columnTrack")]
private static extern ref int ColumnTrack(TextView view);

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 502 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_shiftSelecting")]
private static extern ref bool ShiftSelecting(TextView view);

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 505 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_copyWithoutSelection")]
private static extern ref bool CopyWithoutSelection(TextView view);

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 508 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_selectionStartRow")]
private static extern ref int SelectionStartRowField(TextView view);

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 511 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Field, Name = "_selectionStartColumn")]
private static extern ref int SelectionStartColumnField(TextView view);

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 514 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Method, Name = "set_CurrentRow")]
private static extern void SetCurrentRow(TextView view, int row);

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 517 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Method, Name = "set_CurrentColumn")]
private static extern void SetCurrentColumn(TextView view, int column);

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 520 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Method, Name = "InsertAllText")]
private static extern void InsertAllText(TextView view, string text, bool fromClipboard);

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 523 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

[UnsafeAccessor(UnsafeAccessorKind.Method, Name = "ProcessMouseClick")]
private static extern void ProcessMouseClick(TextView view, Mouse mouse, out List<Cell> line);

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT osx-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-arm64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT win-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / AOT linux-x64

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (ubuntu-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'

Check warning on line 526 in src/TuiCode.Editor/EditorTextView.Carets.cs

View workflow job for this annotation

GitHub Actions / build-test (windows-latest)

'TextView' is obsolete: 'TextView is superseded by tui-cs/Editor's EditorView, which provides a rope-backed document model, cell-aware rendering, multi-caret editing, undo, syntax highlighting, folding, find/replace, and soft wrap. See https://github.com/tui-cs/Editor for details.'
}
167 changes: 167 additions & 0 deletions tests/TuiCode.Tests/TerminalPasteHostTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
using Terminal.Gui.Drivers;
using Terminal.Gui.Input;
using Terminal.Gui.ViewBase;
using Terminal.Gui.Views;
using TuiCode.Editor;
using TuiCode.Explorer;
using TuiCode.Workbench;
using TuiCode.Workbench.Navigation;
using TuiCode.Workbench.Parts;
using TuiCode.Workbench.Services;
using Point = System.Drawing.Point;

namespace TuiCode.Tests;

// The terminal's own paste arrives as a bracketed paste (#446). Boots a TG Application — serialised (#77).
public class TerminalPasteHostTests : StaticConfigurationTest
{
[Fact]
public async Task An_indented_block_goes_in_verbatim_and_one_undo_takes_it_out()
{
using var workbench = Workbench();
using var host = Host(workbench);
string[] pasted = [];

await HostSteps.Run(host,
() => Open(workbench, " if (x)\nend", At(0, 10)),
() => Editing(host, workbench),
() => Paste(host, "\r\n {\r\n\tcall();\n nested;\n }"),
() => { pasted = [.. Tab(workbench).Lines]; host.App.InjectKey(Key.Z.WithCtrl); });

Assert.Equal([" if (x)", " {", "\tcall();", " nested;", " }", "end"], pasted);
Assert.Equal([" if (x)", "end"], Tab(workbench).Lines);
Assert.Equal([At(0, 10)], Tab(workbench).TextView.Carets);
}

[Fact]
public async Task A_paste_replaces_the_selection()
{
using var workbench = Workbench();
using var host = Host(workbench);
string[] pasted = [];

await HostSteps.Run(host,
() => Open(workbench, "one two three", new Caret(new Point(7, 0), new Point(4, 0), Extending: true)),
() => Editing(host, workbench),
() => Paste(host, "2\n 2b"),
() => { pasted = [.. Tab(workbench).Lines]; host.App.InjectKey(Key.Z.WithCtrl); });

Assert.Equal(["one 2", " 2b three"], pasted);
Assert.Equal(["one two three"], Tab(workbench).Lines);
}

[Theory]
[InlineData("1\n2", new[] { "a1", "b2" })]
[InlineData("xy", new[] { "axy", "bxy" })]
public async Task A_paste_goes_in_at_every_caret_as_ctrl_V_does(string text, string[] expected)
{
using var workbench = Workbench();
using var host = Host(workbench);
string[] pasted = [];
string[] undone = [];

await HostSteps.Run(host,
() => Open(workbench, "a\nb", At(0, 1), At(1, 1)),
() => Editing(host, workbench),
() => Paste(host, text),
() => { pasted = [.. Tab(workbench).Lines]; host.App.InjectKey(Key.Z.WithCtrl); },
() =>
{
undone = [.. Tab(workbench).Lines];
host.App.Clipboard!.SetClipboardData(text);
Tab(workbench).TextView.SetCarets([At(0, 1), At(1, 1)]);
host.App.InjectKey(Key.V.WithCtrl);
});

Assert.Equal(expected, pasted);
Assert.Equal(["a", "b"], undone);
Assert.Equal(expected, Tab(workbench).Lines);
}

[Fact]
public async Task A_paste_leaves_the_clipboard_alone()
{
using var workbench = Workbench();
using var host = Host(workbench);

await HostSteps.Run(host,
() => { host.App.Driver!.Clipboard = new TestClipboard { Text = "clip" }; Open(workbench, "a", At(0, 1)); },
() => Editing(host, workbench),
() => Paste(host, "pasted"));

Assert.Equal(["apasted"], Tab(workbench).Lines);
Assert.Equal("clip", host.App.Clipboard!.GetClipboardData());
}

[Fact]
public async Task A_paste_into_the_find_field_goes_there()
{
using var workbench = Workbench();
using var host = Host(workbench);
var typed = "";

await HostSteps.Run(host,
() => Open(workbench, "a needle", At(0, 0)),
() => host.App.InjectKey(Key.F.WithCtrl),
() => host.App.Navigation!.GetFocused() is TextField,
() => Paste(host, "needle"),
() => { typed = host.App.Navigation!.GetFocused()!.Text; });

Assert.Equal("needle", typed);
Assert.Equal(["a needle"], Tab(workbench).Lines);
}

[Fact]
public async Task A_paste_into_a_dialogs_field_goes_there()
{
using var workbench = Workbench();
using var host = Host(workbench);
var typed = "";

await HostSteps.Run(host,
() => Open(workbench, "a\nb\nc", At(0, 0)),
() => Editing(host, workbench),
() => { host.App.InjectKey(Key.G.WithCtrl); host.App.InjectKey(Key.L); },
() => InDialog(host),
() => Paste(host, "3"),
() => { typed = host.App.Navigation!.GetFocused()!.Text; host.App.InjectKey(Key.Esc); });

Assert.Equal("3", typed);
Assert.Equal(["a", "b", "c"], Tab(workbench).Lines);
}

private static bool InDialog(WorkbenchHost host)
{
for (var view = host.App.Navigation!.GetFocused(); view is not null; view = view.SuperView)
if (view is GoToLineView) return true;
return false;
}

private static void Paste(WorkbenchHost host, string text) => Assert.True(host.App.RaisePasteEvent(text));

private static bool Editing(WorkbenchHost host, Workbench.Workbench workbench) =>
host.App.Navigation!.GetFocused() == Tab(workbench).TextView;

private static Caret At(int row, int column) => new(new Point(column, row));

private static EditorTab Tab(Workbench.Workbench workbench) => workbench.Editor.Group.ActiveTab!;

private static void Open(Workbench.Workbench workbench, string content, params Caret[] carets)
{
var fs = new MockFileSystem();
fs.AddFile("/work/a.txt", new MockFileData(content));
workbench.OpenFile(fs.FileInfo.New("/work/a.txt"));
Tab(workbench).FocusContent();
Tab(workbench).TextView.SetCarets(carets);
}

private static Workbench.Workbench Workbench() =>
new(new SidebarPart(new FileExplorerView()), new EditorPart(), new StatusBarPart());

private static WorkbenchHost Host(Workbench.Workbench workbench)
{
var commands = new CommandService();
return new WorkbenchHost(workbench, commands, new KeybindingService(commands), new InputScopeStack(),
new InMemorySettingsService(), driverName: DriverRegistry.Names.ANSI);
}
}
Loading