Syntax highlighting breaks for non-English text with file links, selection also behaves incorrectly #1262

Closed
opened 2026-02-16 17:30:11 -05:00 by yindo · 1 comment
Owner

Originally created by @dmitriyyan on GitHub (Aug 12, 2025).

Originally assigned to: @adamdotdevin on GitHub.

When using non-English text (e.g., Russian) in chat messages containing file links, syntax highlighting breaks.
Additionally, text selection in such messages behaves incorrectly, highlighting is inconsistent and sometimes misaligned.

Steps to Reproduce

  1. Open the chat interface in opencode.
  2. Send a message in a non-English language (e.g., Russian) that includes a file link reference, for example:
    кратко в одну строку проанализируй @README.md
  3. Observe how syntax highlighting works compared to the same message in English.
  4. Try selecting the text in the broken-highlighted message.

Expected Behavior

  • Syntax highlighting should work consistently for all languages, including non-English text.
  • Text selection should behave normally and align with the actual characters.

Actual Behavior

  • Syntax highlighting breaks after the file link when using non-English text.
  • Text selection becomes misaligned or broken (see screenshots).

Screenshots

Image Image

Environment

  • opencode version: v0.4.2
  • GitHub Copilot: GPT-4.1 build agent
  • OS: macos 15.6
  • Terminal/Editor: ghostty, warp

Additional Context

This bug only appears with non-English text. English text with file links displays and selects correctly.


P.S. Fell in love with this software, thank you so much for what you’re doing ❤️

Originally created by @dmitriyyan on GitHub (Aug 12, 2025). Originally assigned to: @adamdotdevin on GitHub. When using non-English text (e.g., Russian) in chat messages containing file links, syntax highlighting breaks. Additionally, text selection in such messages behaves incorrectly, highlighting is inconsistent and sometimes misaligned. ## Steps to Reproduce 1. Open the chat interface in `opencode`. 2. Send a message in a non-English language (e.g., Russian) that includes a file link reference, for example: `кратко в одну строку проанализируй @README.md` 3. Observe how syntax highlighting works compared to the same message in English. 4. Try selecting the text in the broken-highlighted message. ## Expected Behavior - Syntax highlighting should work consistently for all languages, including non-English text. - Text selection should behave normally and align with the actual characters. ## Actual Behavior - Syntax highlighting breaks after the file link when using non-English text. - Text selection becomes misaligned or broken (see screenshots). ## Screenshots <img width="1536" height="1029" alt="Image" src="https://github.com/user-attachments/assets/71714df3-1b33-4152-8025-1479c1b8d7e3" /> <img width="1536" height="1029" alt="Image" src="https://github.com/user-attachments/assets/162952b6-4e65-4617-9547-b712527eba7a" /> ## Environment - **opencode version:** v0.4.2 - **GitHub Copilot:** GPT-4.1 build agent - **OS:** macos 15.6 - **Terminal/Editor:** ghostty, warp ## Additional Context This bug only appears with non-English text. English text with file links displays and selects correctly. --- **P.S.** Fell in love with this software, thank you so much for what you’re doing ❤️
yindo closed this issue 2026-02-16 17:30:11 -05:00
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1262