Skip to content

Conversation

@avinizhanov
Copy link
Contributor

Description

I think it crashed because file.canClose had withDelegate: self instead of WorkspaceDocument.
I didn't find an easy way to pass WorkspaceDocument to Editor, so I copied document(_:shouldClose:contextInfo:) to Editor and it helped.

I moved it to separate method canCloseTab, if user in alert select Cancel it will not close tab.

Also when tab close added:
item.fileDocument = nil

Previously it kept file in memory and didn't reload content when you reopened file.

Related Issues

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.2023-10-16.at.5.24.22.PM.mov

austincondiff
austincondiff previously approved these changes Oct 17, 2023
Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

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

Looks good!

@austincondiff austincondiff merged commit 2cf0170 into CodeEditApp:main Oct 18, 2023
@thecoolwinter thecoolwinter added the bug Something isn't working label Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants