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

[Unexpected Behaviour] Line selection inserts new lines #274

Open
mjoork opened this issue Apr 3, 2021 · 1 comment
Open

[Unexpected Behaviour] Line selection inserts new lines #274

mjoork opened this issue Apr 3, 2021 · 1 comment

Comments

@mjoork
Copy link

mjoork commented Apr 3, 2021

Unexpected Behaviour

When you select lines using CTRL+L, if it is the last line (or EOF I believe) it will start inserting new lines.

Expected behaviour

CTRL+L does nothing, if there's nothing more to select.

ctrl_L.mp4
@mjoork mjoork changed the title Line selection creates new lines Line selection inserts new lines Apr 3, 2021
@mjoork
Copy link
Author

mjoork commented Apr 3, 2021

Well, sorry for claiming this was a bug, just found that it is indeed a feature. But IMHO this shouldn't be the default, because I believe it is not the expected behaviour when selecting lines.

["doc:select-lines"] = function()
local line1, _, line2, _, swap = doc():get_selection(true)
append_line_if_last_line(line2)
doc():set_selection(line1, 1, line2 + 1, 1, swap)
end,

Because, in a situation where you repeatedly select a lot of lines before the end-of-file, it can be difficult to stop in time before new lines get inserted, thus creating some frustration.

@mjoork mjoork changed the title Line selection inserts new lines [Unexpected Behaviour] Line selection inserts new lines Apr 3, 2021
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

1 participant