[PR #542] [MERGED] fix(core): keep keyboard selection anchor stable across scroll #607

Closed
opened 2026-03-02 23:47:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/542
Author: @simonklee
Created: 1/16/2026
Status: Merged
Merged: 1/18/2026
Merged by: @kommander

Base: mainHead: fix/textarea-scrollable-select-behaviour


📝 Commits (10+)

  • ebe6133 fix: select buffer home/end behaviour when textarea's content overflows
  • b138bc0 rm unnecessary logic
  • ace3c0c fix(core): simplify keyboard selection without FFI
  • 048c280 fix(core): clear selection state when range is empty
  • 665d658 fix(textarea): improve scrollable select behaviour
  • 4f679bf fix: scroll viewport to follow cursor during keyboard selection
  • 85d726d chore(core): cleanup code
  • f3f6b97 native optional follows cursor
  • 27e70dc distinct keyboard selection
  • 085f6b3 Merge branch 'main' into fix/textarea-scrollable-select-behaviour

📊 Changes

6 files changed (+239 additions, -9 deletions)

View changed files

📝 packages/core/src/editor-view.ts (+4 -0)
📝 packages/core/src/renderables/EditBufferRenderable.ts (+12 -2)
📝 packages/core/src/renderables/__tests__/Textarea.selection.test.ts (+200 -1)
📝 packages/core/src/zig.ts (+10 -2)
📝 packages/core/src/zig/editor-view.zig (+8 -2)
📝 packages/core/src/zig/lib.zig (+5 -2)

📄 Description

Refactor EditBufferRenderable keyboard shift-selection to track a logical anchor and viewport delta, ensuring the cursor stays visible while selection updates correctly when the viewport scrolls (e.g. Shift+Home/End).

This is a continuation of https://github.com/anomalyco/opentui/pull/522 without FFI plumbing for fixing #521


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/542 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 1/16/2026 **Status:** ✅ Merged **Merged:** 1/18/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix/textarea-scrollable-select-behaviour` --- ### 📝 Commits (10+) - [`ebe6133`](https://github.com/anomalyco/opentui/commit/ebe61336623787fd64b1bff496a31e38661304a6) fix: select buffer home/end behaviour when textarea's content overflows - [`b138bc0`](https://github.com/anomalyco/opentui/commit/b138bc08490fad42bf8340709cfdb223d1e452a6) rm unnecessary logic - [`ace3c0c`](https://github.com/anomalyco/opentui/commit/ace3c0c523367074289ec8d82aa9d61243551f8c) fix(core): simplify keyboard selection without FFI - [`048c280`](https://github.com/anomalyco/opentui/commit/048c28043904fdd2862dd8d3f0ff601c26c6c7ff) fix(core): clear selection state when range is empty - [`665d658`](https://github.com/anomalyco/opentui/commit/665d658fa4c2ff046c46daf4213b61c74261c534) fix(textarea): improve scrollable select behaviour - [`4f679bf`](https://github.com/anomalyco/opentui/commit/4f679bf0ce561bbeaed5860562a1bee998c22f61) fix: scroll viewport to follow cursor during keyboard selection - [`85d726d`](https://github.com/anomalyco/opentui/commit/85d726d95ad36c30c72663076c37295e0cb569c1) chore(core): cleanup code - [`f3f6b97`](https://github.com/anomalyco/opentui/commit/f3f6b979b58872e2fbd8381612b3f9431bf27a5e) native optional follows cursor - [`27e70dc`](https://github.com/anomalyco/opentui/commit/27e70dc76bdcefbd69297a61d2ba427f7b026fb4) distinct keyboard selection - [`085f6b3`](https://github.com/anomalyco/opentui/commit/085f6b364796ddec175f1a9e484e93bbcb64c016) Merge branch 'main' into fix/textarea-scrollable-select-behaviour ### 📊 Changes **6 files changed** (+239 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/editor-view.ts` (+4 -0) 📝 `packages/core/src/renderables/EditBufferRenderable.ts` (+12 -2) 📝 `packages/core/src/renderables/__tests__/Textarea.selection.test.ts` (+200 -1) 📝 `packages/core/src/zig.ts` (+10 -2) 📝 `packages/core/src/zig/editor-view.zig` (+8 -2) 📝 `packages/core/src/zig/lib.zig` (+5 -2) </details> ### 📄 Description Refactor EditBufferRenderable keyboard shift-selection to track a logical anchor and viewport delta, ensuring the cursor stays visible while selection updates correctly when the viewport scrolls (e.g. Shift+Home/End). This is a continuation of https://github.com/anomalyco/opentui/pull/522 without FFI plumbing for fixing #521 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#607
No description provided.