Repository navigation
Yank the block under the cursor with gy - #14
Merged
Merged
Conversation
A reader who has found the code fence, the table or the image they want had to leave R for S and yank it by hand. `gy` now takes that block from either state: a fence contributes the lines between its fences whatever its language, mermaid included, a table its own source lines with the pipes, an image its `` reference characterwise — into the unnamed register and `0`, linewise where the block is linewise. Off all of them the key goes back to Vim untouched, and it never spawns the engine. `preview.lua` grows `find_code_fence` beside `find_fence`, both on one shared scan with a predicate deciding which fences count, so `<CR>` still previews only mermaid fences. Co-Authored-By: Claude Code <noreply@anthropic.com>
The block under the cursor can now be taken from either state with `gy`: a code fence gives the lines between its fences, a table its source lines, an image its reference. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
What
gycopies the block under the cursor, from R and from S: a fenced code block of any language gives the lines between its fences, a GFM table its own source lines, an image itsreference characterwise. The text goes into the unnamed and0registers, the cursor stays put, and no engine process is spawned. Off a copyable block — a paragraph, a heading, a list item, an indented code block — the key goes back to Vim untouched.preview.luagainsfind_code_fencebesidefind_fenceon one shared scan, so<CR>keeps previewing only mermaid fences.Verification
MDRN_REPO=$PWD nvim --headless -l tests/headless/run.lua— 1598 checks, 0 failed (new section 8.6: 26 checks)nvim -l tests/interactive/run.lua— 83 checks, 0 failedcargo fmt -p md-render -- --check,cargo clippy -p md-render --all-targets --locked -- -D warnings,cargo test --workspace --locked— cleanbash tools/check-readme.sh,openspec validate --all --no-interactive— cleanOpenSpec change
add-yank-block-keyis archived in this branch and its requirement is synced intoopenspec/specs/nvim/render-mode/spec.md.🤖 Generated with Claude Code