godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 93 forks source link

Do not give script editor immediate focus after error, `breakpoint`, or failed `assert` #2987

Open Error7Studios opened 3 years ago

Error7Studios commented 3 years ago

Describe the project you are working on

N/A. Applies to any project.

Describe the problem or limitation you are having in your project

When hitting an error, breakpoint, or failed assert, the script editor instantly gets mouse/keyboard focus. This often causes you to accidentally start typing into the script. If you're clicking/dragging the mouse when this happens, you can easily start selecting and overwriting multiple lines.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Highlight the error, breakpoint, or assert line, but don't give the script editor focus until after a 0.5 second (or so) delay. The delay could be configured/disabled in Project Settings.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

ScriptEditorFocusDelay

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. You can undo the accidental changes, but that's only if you realize you've accidentally made a change.

Is there a reason why this should be core and not an add-on in the asset library?

I think this is a common enough problem to be core.

KoBeWi commented 3 years ago

This doesn't apply only to assert/breakpoint, but to any error that can cause debugger break. I opened an issue about it long time ago: https://github.com/godotengine/godot/issues/21812