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

EditorManager Always Opens Files #1892

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thecoolwinter
Copy link
Collaborator

Description

Updates the editor manager to use a private variable for the selected tab, and a setter method. This method handles opening the underlying code document if necessary and moves the ownership of opening the code file to the editor manager. This was unclear before, which led to documents being opened multiple times (there was a comment in the editor.swift file about this earlier).

This also updates the history to use the CEWorkspaceFile rather than tabs, to indicate that items in the history are unrelated to their UI representation and are given a new tab instance when opened (if necessary).

Also updates the loading indicator to update the UI when it receives an update as well as attempt to do so when it appears. This change ensure that if the code file property is set, it is reflected in the UI.

Related Issues

  • N/A

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2024-09-26.at.12.21.32.PM.mov

@thecoolwinter thecoolwinter changed the title Editor Opens All Files Files In Tabs Are Always Opened Sep 26, 2024
@thecoolwinter thecoolwinter added bug Something isn't working workspace labels Sep 26, 2024
@thecoolwinter thecoolwinter changed the title Files In Tabs Are Always Opened Editor Always Opens Files Sep 27, 2024
@thecoolwinter thecoolwinter changed the title Editor Always Opens Files EditorManager Always Opens Files Sep 27, 2024
Copy link
Member

@activcoding activcoding left a comment

Choose a reason for hiding this comment

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

Reviewed, untested

}
self.selectedTab = tab
if tab.file.fileDocument == nil {
do { // eat this error for ease of API use.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
do { // eat this error for ease of API use.
do { // Ignore this error for simpler API usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants