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

In the script editor, make following a link always add to the page history #4462

Open
snailrhymer opened this issue Apr 29, 2022 · 3 comments

Comments

@snailrhymer
Copy link

snailrhymer commented Apr 29, 2022

Describe the project you are working on

Generic use of the script editor.

Describe the problem or limitation you are having in your project

When I follow a link in the script editor or built in docs docs that takes me to elsewhere in the same page, I can't use the back button to return to my original position - it takes me to the last page instead.

In the script editor for 3.x (though not the docs), the back button would take you back to the last position on the same page. The online docs (and e.g. Wikipedia) also have this functionality.

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

Make following any link add to the page history, instead of only when it takes you to another page.

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

Currently, editor_help scrolls directly to the correct paragraph when a link on the same page is clicked. If instead, it emitted the "go_to_help" signal with topic + ":" + class_name + ":" + link, the desired behaviour is achieved (though I don't know how to get the class name in general).

I imagine something analgous would work for script pages.

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

It can be worked around by scrolling back to where you were when you clicked the link, but this is mildly inconvenient.

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

It's core editor funcitonality.

@KoBeWi
Copy link
Member

KoBeWi commented Apr 29, 2022

Related: godotengine/godot#16554
I wouldn't limit it only to following links, but for any script jump greater than 9 lines. VS Code has such feature and it's great.

@noidexe
Copy link

noidexe commented Jun 1, 2022

I was about to post the same proposal. I know the arrow says "Go to previous edited document" but I assume everyone who's ever used a browser is expecting standard back button behavior.
Sometimes is really confusing.
E.g:

  • You are reading the list of methods for ClassA
  • A method returns ClassB and you want to know more about it so you click on it
  • You click on a method of ClassB and the script editor scrolls down to its definition
  • You then click back and are back at a method list, only it's for ClassA, not ClassB

If you are a newbie user this is more than a minor inconvenience. It can be really confusing since the only way to realize you're at the wrong place is noticing all the methods are suddenly different.

@snailrhymer
Copy link
Author

snailrhymer commented Jul 30, 2022

See also godotengine/godot#63515 for

I wouldn't limit it only to following links, but for any script jump greater than 9 lines. VS Code has such feature and it's great.

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

No branches or pull requests

3 participants