-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Empty hidden editors #14909
Empty hidden editors #14909
Conversation
Fixes eclipse-theia#14880 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
Signed-off-by: Thomas Mäder <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workaround fixes the main issue on my machine. However it seems to introduce other behavior changes.
See this video for changes between the latest Theia IDE and the Electron Example of this branch:
OpeningEditorsRegression.mp4
The current Theia IDE behavior is already not that great:
- The editors are opened on the correct line on first click, however the top overlay swallows the selected text. Still the editors are "almost" correct
- On second click the correct line is shown centered in the UI
On this branch:
- More often than not, the editor just opens on the last line of the file which is bad behavior
- The second click then works fine, centering the line in the UI
As this breaks just clicking on file results for me in the IDE, I would not recommend merging in this state. In both cases it would be better if the selected line would immediately be centered, just like on the second click.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: I tested the latest master
and there the same last-line issue appears. So it's not a regression of this branch, but something else on master
.
As the main issue is fixed, I'll approve
Edit2: Maybe it's a me issue 🤷, I went back several Theia versions on master
and still encounter this issue when running the example apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that this works as expected and does not introduce any regressions (I specifically checked the notebook integration as well, which simply behaves as usual).
What it does
Monaco editors don't work correctly when they are hidden by setting
display: none
. This PR unsets the editor model from the editor when it is hidden and restores it when the editor is revealed again.Fixes #14880
How to test
Test the scenario from the related issue. Have an eye out for an missing state in the editor or focus issues. This needs to be tested on Linux to make sure the issue is fixed as it did not happen on Windows.
Follow-ups
Breaking changes
Attribution
Contributed on behalf of STMicroelectronics
Review checklist
Reminder for reviewers