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

Fix TextFile not reloading when changed from external editors #81319

Conversation

KurtBliss
Copy link
Contributor

@KurtBliss KurtBliss commented Sep 4, 2023

Fixes #81318

@KurtBliss KurtBliss requested a review from a team as a code owner September 4, 2023 23:39
@KurtBliss
Copy link
Contributor Author

KurtBliss commented Sep 5, 2023

I should've mentioned this in the OP.

This PR tries fixing the TextFile's resource last modified date is always being the same as the current date in the void ScriptEditor::reload_scripts(bool p_refresh_only) function.

I noticed the TextFile::load_text(const String &p_path) function was updating the last_modified_time (EDIT: in the EditorNode::_resources_changed function) before it was called later in the reload_scripts function.

@KurtBliss KurtBliss force-pushed the Changing-text-files-in-an-external-editor-doesn't-cause-them-to-reload-in-Script-Editor branch from 507dabb to 346432a Compare September 5, 2023 02:00
@Chaosus Chaosus added this to the 4.2 milestone Sep 5, 2023
@KurtBliss KurtBliss force-pushed the Changing-text-files-in-an-external-editor-doesn't-cause-them-to-reload-in-Script-Editor branch from 346432a to bb98843 Compare September 6, 2023 21:35
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. It's consistent with script files.

@akien-mga akien-mga changed the title Fxed TextFile's not reloading when changed from external editors Fix TextFile not reloading when changed from external editors Oct 1, 2023
@akien-mga akien-mga merged commit 6b70dfe into godotengine:master Oct 2, 2023
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Changing text files in an external editor doesn't cause them to reload in Script Editor
4 participants