-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Comments
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. |
Hi I think this is addressed in #3221 Experimenting If you want to replace the clipboard with the current line try binding "Ctrlk": "SelectLine,Copy,Delete", Kind Regards Gavin Holt |
Came here from #3477.
Those rules are indeed tricky: the cut buffer is cleared if it has been already pasted at least once, or if the last cut was more than 10 seconds ago. (I also described it in the commit message in my 52ed431.) Actually the last part (about 10 seconds) never really worked, due to a bug in the code (so I threw it away in 68d6f43). So the actual rules are simply: the cut buffer is cleared if it has been already pasted at least once. Still, yeah, this behavior is not quite intuitive, and doesn't seem quite useful. I would be happy to throw it away, if I could be sure there are no users that actually prefer this behavior.
Yeah, this behavior sounds more useful than the current one. Honestly, I wouldn't bother even with that, I'd prefer to replace the current behavior with the simplest and the most intuitive and predictable one: always cut single line only. I guess that is what a lot of users would prefer over any multiline cut functionality, see e.g. #3477 and #3221. @JoeKar @Neko-Box-Coder @Andriamanitra so I'm thinking: what if we replace the current behavior with the simple single-line-cut only one (i.e. make (And then maybe in the future we add back multiline cut functionality as well, in one form or another, with a separate action e.g. |
Or perhaps removing multiline cut functionality altogether right away would be too drastic, so instead:
BTW the current behavior has an "advantage" over nano: it allows cutting lines that are not necessarily consecutive. But I'm not sure if this "advantage" was implemented intentionally, not just thoughtlessly. |
Yeah, I agree we should change
I think the current multiline cut implementation is quite cool (although I don't really use it) but if enough people expect it to behave exactly like nano (even though we never said it behaves like nano), then maybe should change it.
Separating the multiline cut feature as |
I don't like messing with the defaults without a really good reason because it always surprises some users (even if they are not annoyed enough to raise an issue about it). However I think most of the surprising behavior would be addressed by changing The idea to add a separate |
When pasting, we get as many lines as we have cut before by ctrl-x.
But how can i paste just one last line?
The text was updated successfully, but these errors were encountered: