fix(tui): support copy mode over markdown tables#205
Merged
Conversation
Author
|
One for review when you get a moment :D @leohenon |
leohenon
reviewed
Jun 29, 2026
| const min = motionMin(row, cache) | ||
| return text.slice(Math.max(0, start.col - min), Math.max(0, end.col - min + 1)) | ||
| } | ||
| return Array.from({ length: end.idx - start.idx + 1 }, (_, i) => ({ row: list[start.idx + i], i: start.idx + i })) |
Owner
There was a problem hiding this comment.
I noticed charwise table selections include non copyable separator rows as blank lines. Can we filter rowCopyable(row, cache) here, and in the block visual path above, matching the linewise behavior?
- skip non-copyable table rows in visual copy
Owner
|
I just added a comment for the table internals, and a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In copy mode, visual-line/char/block selection over markdown tables copied nothing or showed only a 1-character placeholder highlight. Tables render as TextTableRenderable, which exposes neither
plainTextnorlineInfo, so copy-mode's renderable walk skipped them.Fix
Before
After
Tests
bun test test/cli/tui/vim-motions.test.tsfrompackages/tui: 731 passbun typecheckfrompackages/tui: pass