-
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
[Feature request]: Duplicate lazy line selection #3110
Comments
I'm using the following in my init.lua for lazy line selection:
I have
So in particular you could use these to quickly select a few whole lines via |
Hi, Many thanks for sharing your functions - taking this as inspiration - and combining with #2583, I have written a
This can be called before
Unfortunately these manipulations change the current selection (so you can't make multiple copies). I will leave this open as I still feel Kind Regards Gavin Holt |
I guess we can close this now as there is a work-around. Kind Regards Gavin Holt |
Hi, After downloading the new binary today, my This function is only used to extend the selection before using the
It fails only when the lazy selection if from the bottom upwards! Generally Micro will act upon partly selected lines (top down or bottom up) for all the following :
Not wanting to upset the current users of Kind Regards Gavin Holt PS. Naming things is hard: given a free hand I would rename |
Yes, we changed the behavior to always ignore the direction of selection. First, to make it at least consistent (and to fix bugs caused by its inconsistency), second, because apparently some users even prefer this ignore-direction-of-selection behavior. You can use something like this now:
I'm thinking about the same. We may clean up and unify things by changing behavior of some action without changing behavior of the default keys bound to them (so that the change would not affect most users): bind Ctrl-c to |
Implemented in #3335. With this PR you will probably not need your |
Hi I have been giving more thought to
All of these situations leave the cursor position/selection unchanged, and therefore can be repeated for multiple duplication. My Lua function satisfies my needs, but would be better as a built in
Kind Regards Gavin Holt |
Hi
My name is Gavin, and I am a lazy line selector.
I have tried to go straight, but lack the willpower to make pinpoint accurate line selections.
I blame a troubled relationship with the mouse, we never bonded, and I have no love for the little rodent.
My condition is so bad, that sometimes my lazy line selection is backwards - from bottom up!
Thankfully, there is a near perfect solution, the micro editor.
Micro will act upon partially selected lines:
MoveLinesDown
MoveLinesUp
IndentSelection
OutSelection
lua:comment.comment
Textfilter
SpawnMultiCursorSelect
The only irregular command I have discovered so far is
DuplicateLine
, and it trips me up hourly. With no selection, the current line is duplicated. However, with any text selected - only that text is duplicated (see #416).To duplicate a set of lines, I have to make a pinpoint selection, remembering to include the end-of-line character (not selected with a simple shift end!).
I guess many users will be accustomed to the default behaviour, and it would be unfair for my affliction to inconvenience the majority of law-abiding precision line selectors.
My ideal solution would be a pair of functions
DuplicateLinesBelow
andDuplicateLinesAbove
, which would make copies of the current lazy line selections above or below AND leave my selection (and clipboard) unchanged. e.g.Before
DuplicateLinesBelow
:After
DuplicateLinesBelow
:I am not good at manipulating bp.Cursor.Loc, so a Lua solution is beyond my abilities.
Any help for an incurable lazy line selector would be welcome.
Kind Regards Gavin Holt
OS: Windows 10
Version: 2.0.13
Commit hash: 68d88b5
Compiled on December 12, 2023
The text was updated successfully, but these errors were encountered: