godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix code editor moving lines without selected characters

Open aXu-AP opened this issue 2 years ago • 1 comments

Fixes #54362 Supersedes #54392

When the selection ends at the start of new line, move_lines_up/down shouldn't affect that line.

A question was raised in https://github.com/godotengine/godot/pull/54392#pullrequestreview-796888504, if line should be moved when the selection covers only carriage return of a line. As an answer @jmb462 noticed that there's a visual difference, which could warrant different behaviour. I opened an issue to fix peculiar and ambiguous selection visuals: #72265 This pr handles the problem in line with other code editors, so that only selections ending at new line will be affected.

aXu-AP avatar Jan 28 '23 19:01 aXu-AP

Delete Lines is outlier not only by behaviour, but the default hotkey is strange as well. I wonder why it isn't shift+delete as in lot of other editors (refer VS Code, Visual Studio)? I had already forgotten this, because I changed it 2 years ago and haven't looked back 😄 EDIT: Ah yes, shift+delete is by default cut. I recall having that problem of changing the contents of clipboard when I wanted to delete some lines. It seems that Notepad++ defaults to shift+delete being cut as well. Well, each to their own, it's not a real issue since it's customizable. I might look at that as well, however I think it's better to open another issue/pr for that?

aXu-AP avatar Jan 28 '23 20:01 aXu-AP

Superseded by https://github.com/godotengine/godot/pull/72672.

YuriSizov avatar Feb 03 '23 20:02 YuriSizov