Skip to content

fix(tui): preserve list prefixes in copy mode#150

Merged
leohenon merged 1 commit into
leohenon:ocvfrom
shaheislam:visual-fix
May 20, 2026
Merged

fix(tui): preserve list prefixes in copy mode#150
leohenon merged 1 commit into
leohenon:ocvfrom
shaheislam:visual-fix

Conversation

@shaheislam
Copy link
Copy Markdown

@shaheislam shaheislam commented May 19, 2026

Summary

Fixes TUI copy mode so yanking rendered lines preserves list/status prefixes that are visible in the UI.

This covers both:

  • Markdown source prefixes like - item, 1. item, and - [x] item
  • Separate same-row rendered prefixes like [✓] Inspect current branch

Before

Screenshot 2026-05-20 at 00 10 37

After

Screenshot 2026-05-20 at 00 09 55

Details

Copy mode previously copied the main rendered text for a row but could drop prefixes when they were rendered separately or
transformed from Markdown source.

This change tracks horizontal renderable positions so copy mode can include visible same-row prefixes to the left of the
copied content. It also restores Markdown list markers from the original source where available, so rendered bullets or task
checkboxes copy back as Markdown.

Tests

  • Added focused copy-mode regression tests for Markdown list prefixes
  • Added focused copy-mode regression tests for visible same-row prefixes
  • Ran bun test test/cli/tui/vim-motions.test.ts
  • Ran bun typecheck

@shaheislam
Copy link
Copy Markdown
Author

@leohenon Hi Leo I've raised a small QoL fix for markdown highlighting in visual mode if you wouldn't mind taking a look please

Copy link
Copy Markdown
Owner

@leohenon leohenon left a comment

Choose a reason for hiding this comment

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

good fix, thanks!

@leohenon leohenon merged commit 46762ac into leohenon:ocv May 20, 2026
1 check 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.

2 participants