-
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
DeleteLine does not delete selected lines #3328
Comments
That is how BTW I don't quite like the way how it is implemented. The |
I think what you are saying is similar but a different issue, possibly an incorrect behavior from But anyway, that's another issue as I said (which could potentially be changed together). I can probably raise a PR for this (and also the issue you mentioned) but that will be after I sorted out the other PRs I have since I am already spending quite a bit of time on other PRs. |
Ah, I've just realized that So, yeah, it makes sense to make Question: if the selection does not fully cover its first and/or last line, should From a pure aesthetics/consistency perspective it seems better if it will delete just the selection: 1. |
I understand it is good to have consistency but if My personal opinion would be it should also delete the first line and last line since that is doing what it says, deleting lines. However, that's just my own opinion. But I think it should at least reacts to selection(s), the action is up for debate and I don't mind other people joining to vote/provide opinions on what they want. |
Yeah, good point. Now it seems more useful to me if it deletes the whole first and last lines. ( |
Hi, You can use Lua to achieve the required deletion. Bind the following to a keyboard shortcut of your choice: "YourKey": "lua:initlua.delsel,SelectLine,Delete", I keep all my Lua in one file function delsel(Current)
-- This avoids deleting EOL when deleting partially selected lines
if Current.Cursor:HasSelection() then
Current.Cursor:DeleteSelection()
end
end This will delete all partly selected lines, or the current line if no selection. Kind Regards Gavin Holt PS I am struggling to achieve similar for duplicate line as my solution is now broken - see #3110. |
This is a smart trick, but it doesn't always work correctly. If the last line of the selection contains the whole line, this will also wrongly remove the next line below the selection. ...I think the behavior of I'm gonna implement a fix, it should be trivial. |
Implemented #3335 which makes |
Description of the problem or steps to reproduce
Where there are multiple lines selected (i.e. line 1 to 10), calling
DeleteLine
should delete all the selected lines, not just the line the cursor is on (i.e. line 10)Specifications
Commit hash: e9bd1b3
OS: Linux
Terminal: WezTerm
The text was updated successfully, but these errors were encountered: