Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rc windowing new-client: copy buffer and selections from calling client #5024

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 17, 2023

  1. rc windowing new-client: quote arguments to prevent string expansion

    Fixes
    
    	:new edit "file with spaces"
    
    Closes mawww#1432
    krobelus committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    48b5485 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2023

  1. rc windowing new-client: copy buffer and selections from calling client

    "new" runs "kak -c" which opens a recently used buffer.  More often
    than not, I rather want to preserve the calling client's buffer and
    selections. For example I might select a word and run "new" followed by
    "grep" on the selected word. If the selection is preserved I can use
    "new grep".  A similar scenario is "new lsp-definition".
    
    Make "new" use the calling client's buffer and selections to support
    such scenarios. Center the viewport with vv, matching "edit <file>
    <line>".
    
    Vim does this in <c-w><c-v>.
    
    Another scenario is when I want to look at two regions from a file,
    side-by-side.
    
    My initial patch used the code below but Zz seems better:
    
    	echo "try %|
    	    buffer -- '$(printf %s "$kak_buffile" | sed "s/'/''/g; s/|/||/g")'
    	    select $kak_selections_desc
    	    execute-keys vv
    	|"
    krobelus committed Nov 18, 2023
    Configuration menu
    Copy the full SHA
    eab1d97 View commit details
    Browse the repository at this point in the history