Skip to content

Conversation

@TheDying0fLight
Copy link
Contributor

@TheDying0fLight TheDying0fLight commented Dec 7, 2025

Resolves #107911

This fixes two things, one is that sometimes the history would not update anymore causing the linked issue (cause for this was line 3873). The other is that closing a file when in the middle of the history would cut off the tail of the history even though it is still valid (line 906).

Also I added two helper functions to replace code used multiple times, making the code more readable (in my opinion, at least helped me with debugging). Are these changes valid? If so should I make a extra PR or a proposal?

@TheDying0fLight TheDying0fLight requested a review from a team as a code owner December 7, 2025 21:24
@AThousandShips AThousandShips added bug topic:editor cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Dec 8, 2025
@AThousandShips AThousandShips added this to the 4.6 milestone Dec 8, 2025

ScriptEditorBase *seb = Object::cast_to<ScriptEditorBase>(n);
if (seb) {
lock_history = true;
Copy link
Member

Choose a reason for hiding this comment

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

This does not look correct. Please explain why it is fine to not lock the history at all here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right this breaks a functionality that I didn't know was there (storing line jumps in the history), but with this removed the other issue is fixed. I will look for a better way to do this

Copy link
Member

Choose a reason for hiding this comment

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

For reference: #113619

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will solve the issue then, you can probably add the issue to your PR. Good that you noticed this

@TheDying0fLight TheDying0fLight marked this pull request as draft December 8, 2025 11:07
@TheDying0fLight
Copy link
Contributor Author

Duplicate PR #113619

@TheDying0fLight TheDying0fLight deleted the correctly-return-to-previous-file-on-close branch December 8, 2025 11:18
@HolonProduction
Copy link
Member

Is this really a full duplicate? My PR only aims to solve the locking issue. I was under the impression this PR includes some other fixes.

@TheDying0fLight
Copy link
Contributor Author

Yes but I would do a new PR for these to make it clean. Or should I just rework this PR?

@HolonProduction HolonProduction added archived and removed cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Dec 8, 2025
@HolonProduction HolonProduction removed this from the 4.6 milestone Dec 8, 2025
@HolonProduction
Copy link
Member

Feel free to do a new one if you want! Just wanted to make sure that we don't loose a useful fix here.

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.

Closing internal help (class reference) do not returns to original file

3 participants