Skip to content

fix: Cyrillic cursor drift (#281)#282

Merged
eugenioenko merged 1 commit into
mainfrom
fix/cyrillic-cursor-drift
Jun 28, 2026
Merged

fix: Cyrillic cursor drift (#281)#282
eugenioenko merged 1 commit into
mainfrom
fix/cyrillic-cursor-drift

Conversation

@eugenioenko

Copy link
Copy Markdown
Owner

Summary

  • Fix bufColToVisualCol and visualColToBufCol to use rune index instead of Go's range loop byte index, which caused cursor drift on multi-byte UTF-8 text (Cyrillic, CJK, etc.)
  • Add 7 unit tests covering Cyrillic strings, mixed ASCII/Cyrillic, and Cyrillic with tabs

Test plan

  • Unit tests fail on broken code (TDD red step confirmed)
  • Unit tests pass after fix (TDD green step confirmed)
  • Full test suite passes (make test)
  • Build succeeds (make build)

Fixes #281

🤖 Generated with Claude Code

https://claude.ai/code/session_018GG9dYw2AG18ro5c2dkPtm

…ioning

bufColToVisualCol and visualColToBufCol used Go's range loop byte index,
which diverges from the rune index for multi-byte UTF-8 characters
(e.g. Cyrillic). This caused cursor drift when editing non-ASCII text.

Fixes #281

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018GG9dYw2AG18ro5c2dkPtm
@eugenioenko eugenioenko merged commit 2a8de37 into main Jun 28, 2026
2 of 3 checks passed
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.

Cursor rendering offset / desync with Cyrillic (UTF-8) characters

1 participant