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

Push jumps to script editor history #4989

Closed
RedMser opened this issue Jul 26, 2022 · 1 comment · Fixed by godotengine/godot#63515
Closed

Push jumps to script editor history #4989

RedMser opened this issue Jul 26, 2022 · 1 comment · Fixed by godotengine/godot#63515
Milestone

Comments

@RedMser
Copy link

RedMser commented Jul 26, 2022

Describe the project you are working on

The Godot Editor

Describe the problem or limitation you are having in your project

Just like Godot, other script editors like Visual Studio (Code) also feature a file history that can be navigated e.g. via the extra mouse buttons.

Their history is a bit more in-depth however, as it records not just navigation between files into the history, but also navigation within the same file. Especially for larger scripts, it can be very useful to quickly navigate inside of the file.

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

The navigation history feature would be extended to not only record a list of opened files, but also a list of jumps that happened within any file.

A jump is considered any of the following:

  • Ctrl+Click onto a member (method, signal, property) which resides within the same file
  • "Go to function" menu option
  • "Go to line" menu option
  • "Go to previous/next bookmark" menu options
  • "Go to previous/next breakpoint" menu options

Great care must be taken to not push the same history item twice (e.g. recording both the jump and the tab switch as separate history entries).

A new editor setting could be introduced to disable this new behavior.

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

By calling ScriptEditor::_save_history for these operations, new history entries are added that automatically include the current line/column and scroll position.

Navigating within the file multiple times will cause the "script temperature" feature to lose its saturation more quickly, so it may need to be changed so it does not increment if there has not been a switch between files.

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

No, this is core functionality that can not be edited externally.

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

This is core functionality that can not be edited externally. It also is a common feature of other IDEs.

@Calinou
Copy link
Member

Calinou commented Jul 26, 2022

See also #954 (comment), which proposed this a while ago.

Feel free to open a pull request for this 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants