Skip to content

OMNIS-39: Edit TUI text fields by grapheme cluster - #47

Merged
JtheGunner merged 1 commit into
mainfrom
fix/OMNIS-39-edit-text-by-grapheme-cluster
Oct 8, 2026
Merged

JtheGunner merged 1 commit into
mainfrom
fix/OMNIS-39-edit-text-by-grapheme-cluster

Conversation

@JtheGunner

Copy link
Copy Markdown
Owner

YouTrack: https://youtrack.xn--wrm-hoa.li/issue/OMNIS-39

The TUI filter and option-value fields moved the cursor and deleted per rune, so one key press hit only part of a combining accent, ZWJ emoji or flag. They now work on grapheme clusters.

Changes

  • editText, pasteText and editWindow snap the cursor to cluster boundaries; left/right/backspace/delete act on whole clusters.
  • pos stays a rune index, so model.go and options.go are unchanged.
  • github.com/rivo/uniseg becomes a direct dependency (it was already in the module graph).
  • Changelog entry under Unreleased.

Test plan

  • go test ./... -race -count=1, go vet ./... and golangci-lint v2.13.2 pass.
  • New tests cover e + U+0301, a ZWJ family emoji and a flag for move, backspace, delete, paste, mid-cluster snap and the scrolled window.
  • Manually: omnishell tui, press / and type a combining accent or flag, then check that arrows and backspace treat it as one character.

Arrow keys, backspace and delete worked per rune, so one key press hit
only part of a combining accent, ZWJ emoji or flag. The cursor now snaps
to cluster boundaries; uniseg becomes a direct dependency.
@JtheGunner
JtheGunner merged commit 7eeb0c4 into main Oct 8, 2026
4 checks passed
@JtheGunner
JtheGunner deleted the fix/OMNIS-39-edit-text-by-grapheme-cluster branch October 8, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant