Skip to content

fix: popup border over wide chars - #354

Merged
RivoLink merged 1 commit into
RivoLink:mainfrom
KisenaMiyuki:cursor/popup-wide-char-border-cb48
Nov 3, 2026
Merged

RivoLink merged 1 commit into
RivoLink:mainfrom
KisenaMiyuki:cursor/popup-wide-char-border-cb48

Conversation

@KisenaMiyuki

Copy link
Copy Markdown
Contributor

Why

When a popup opens over CJK or other wide text, parts of its left border go missing.

A wide character takes two columns. If one starts just to the left of the popup, its right half sits under the popup's left border. Clear only resets cells inside the popup, so that wide character stays in the buffer. When Ratatui diffs the frame, it skips the cell hidden under the wide character's right half, so the border character at that row is never sent to the terminal.

What changed

  • Added clear_popup_area in src/render/mod.rs. It clears the popup rectangle as before, then replaces any wide character just to the left of the popup that reaches into it with a space.
  • Used clear_popup_area in all popups (help, theme, path, and the file, history, and editor pickers).
  • The document is redrawn every frame, so the replaced characters come back as soon as the popup closes.

Testing

  • Added regression tests in src/tests/render_popup.rs covering the theme and help popups over CJK lines, and checking that the characters return after the popup closes.
  • Ran cargo fmt --all -- --check, cargo test, cargo clippy --all-targets --all-features -- -D warnings, and cargo build --release.
  • Checked manually in a terminal by opening the theme picker (T) and help (?) over a CJK document.

Authored by Claude

Co-authored-by: KisenaMiyuki <KisenaMiyuki@users.noreply.github.com>
@RivoLink
RivoLink force-pushed the cursor/popup-wide-char-border-cb48 branch from c5745d7 to 84ffaf3 Compare November 3, 2026 18:11

@RivoLink RivoLink left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this PR!

@RivoLink
RivoLink merged commit 638aa98 into RivoLink:main Nov 3, 2026
1 check passed
RivoLink added a commit that referenced this pull request Nov 3, 2026
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.

2 participants