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

pasting multiple lines after cutting #2653

Open
465788227 opened this issue Dec 2, 2022 · 2 comments
Open

pasting multiple lines after cutting #2653

465788227 opened this issue Dec 2, 2022 · 2 comments

Comments

@465788227
Copy link

When pasting, we get as many lines as we have cut before by ctrl-x.
But how can i paste just one last line?

@465788227 465788227 changed the title getting multiple lines after pasting with ctrl-x pasting multiple lines after ctrl-x Dec 2, 2022
@ghost
Copy link

ghost commented Dec 11, 2022

I think what you're describing is an issue that's been bothering me for the longest time as well, but I never opened an issue about it.

In the nano editor, which I remember micro was inspired by, the cut buffer is cleared when you move the cursor and cut again, so if you cut 5 lines in a row and then paste them, you get all 5, but if you cut 1 line, move, cut another, then paste, you only get the second one. This is the behavior I think both you and I want.

I looked briefly at the source code for this a little bit a long time ago. Apparently, micro has some more complex rules for deciding when to clear the cut buffer, that I still don't completely understand.

@465788227 465788227 changed the title pasting multiple lines after ctrl-x pasting multiple lines after cutting Dec 11, 2022
@Gavin-Holt
Copy link

Gavin-Holt commented May 5, 2024

Hi

I think this is addressed in #3221

Experimenting CTRL+X overwrites the clipboard.
But CutLine appends the line to the clipboard.

If you want to replace the clipboard with the current line try binding CTRL+K like this:

    "Ctrlk": "SelectLine,Copy,Delete",

Kind Regards Gavin Holt
Please close if this fixes your problem

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

No branches or pull requests

2 participants