[PR #557] [MERGED] fix(core): prevent cursor to get stuck at virtual extmark #618

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

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/557
Author: @felixzsh
Created: 1/20/2026
Status: Merged
Merged: 1/26/2026
Merged by: @kommander

Base: mainHead: fix/cursor-stuck-extmark-at-start-line


📝 Commits (5)

  • 24ee6a3 fix(core): prevent cursor to get stuck at virtual extmark
  • e5bf452 Merge remote-tracking branch 'origin/main' into fix/cursor-stuck-extmark-at-start-line
  • cd85aa5 fix(extmarks): land on extmark end to avoid overshoot
  • 80d0bf3 Merge branch 'main' into fix/cursor-stuck-extmark-at-start-line
  • 615b674 Merge branch 'main' into fix/cursor-stuck-extmark-at-start-line

📊 Changes

2 files changed (+111 additions, -1 deletions)

View changed files

📝 packages/core/src/lib/extmarks.test.ts (+107 -0)
📝 packages/core/src/lib/extmarks.ts (+4 -1)

📄 Description

Fix cursor getting stuck when moving down over virtual extmarks at the beginning of lines.When moving vertically over a virtual extmark at the start of a line, the cursor would be forced backwards instead of allowing forward movement. This fix detects when the adjusted position would cause backward movement during down navigation and positions the cursor at the end of the extmark with proper spacing.

the decision on the reposition at the end + 2, was made to be consistent with the current behavior when moving up over virtual extmarks (skiping the line)


🔄 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/557 **Author:** [@felixzsh](https://github.com/felixzsh) **Created:** 1/20/2026 **Status:** ✅ Merged **Merged:** 1/26/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix/cursor-stuck-extmark-at-start-line` --- ### 📝 Commits (5) - [`24ee6a3`](https://github.com/anomalyco/opentui/commit/24ee6a3d9d5c026ef377989549c6c4e600c3739e) fix(core): prevent cursor to get stuck at virtual extmark - [`e5bf452`](https://github.com/anomalyco/opentui/commit/e5bf4525b381b282ba92c7820243adf772aba467) Merge remote-tracking branch 'origin/main' into fix/cursor-stuck-extmark-at-start-line - [`cd85aa5`](https://github.com/anomalyco/opentui/commit/cd85aa54dd504b1d468d7538845026a825a72094) fix(extmarks): land on extmark end to avoid overshoot - [`80d0bf3`](https://github.com/anomalyco/opentui/commit/80d0bf3805d51cffe6a3c8b9fb600aa3dc12d97d) Merge branch 'main' into fix/cursor-stuck-extmark-at-start-line - [`615b674`](https://github.com/anomalyco/opentui/commit/615b6748b32bbc6f9ac5752f90e30edaea01ef40) Merge branch 'main' into fix/cursor-stuck-extmark-at-start-line ### 📊 Changes **2 files changed** (+111 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/lib/extmarks.test.ts` (+107 -0) 📝 `packages/core/src/lib/extmarks.ts` (+4 -1) </details> ### 📄 Description Fix cursor getting stuck when moving down over virtual extmarks at the beginning of lines.When moving vertically over a virtual extmark at the start of a line, the cursor would be forced backwards instead of allowing forward movement. This fix detects when the adjusted position would cause backward movement during down navigation and positions the cursor at the end of the extmark with proper spacing. the decision on the reposition at the end + 2, was made to be consistent with the current behavior when moving up over virtual extmarks (skiping the line) --- <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:22 +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#618
No description provided.