Open AdriaandeJongh opened 7 months ago
VSCode does something similar, when moving the caret up or down there is at least one visible line above and below the caret in view. There is a setting for it called editor.cursorSurroundingLines
to increase the number of lines.
Describe the project you are working on
A game in Godot using the built-in script editor.
Describe the problem or limitation you are having in your project
When I work in the built-in code editor in Godot and add enough code to hit the bottom half of the screen, I regularly have to scroll down to see just what's directly below the code I'm adding. It makes the built-in editor feel a bit immature, as if it doesn't understand that when I'm writing code I'd like to keep seeing the code surrounding it. The editor does scroll down when you create newlines at the very bottom of the viewport, but this doesn't take away the frustration of having to scroll to see the code below from where you are typing.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The editor can be a tiny bit smarter about when to scroll for the user when they are writing code. My feature request is simple: when a user adds newlines to a script that is currently on the bottom half of the built-in script viewport, the script will scroll down as much as the height of a new line, so that it appears everything above the currently selected line scrolls up while everything below stays in place on the screen.
I want to point out that the current behavior essentially means that whatever is at the top appears to remain in place when creating a newline, regardless of where you enter a new line, except for the very bottom of the script where it does scroll down to keep the cursor in view.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I do not know any C++ and how the built-in editor works is a mystery to me. My best guess is: When the user presses return, see if the selected line is in the bottom half of the code viewport, and if so, scroll down by the amount of pixels that is the height of a newline.
If this enhancement will not be used often, can it be worked around with a few lines of script?
n/a
Is there a reason why this should be core and not an add-on in the asset library?
The built-in code editor is part of the core experience of Godot.