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

allow files with a utType that is neither image nor PDF to be previewed #1822

Merged

Conversation

plbstl
Copy link
Contributor

@plbstl plbstl commented Jul 23, 2024

Description

Forgot an extra else statement. See f9433bd (#1783)

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

thecoolwinter
thecoolwinter previously approved these changes Jul 27, 2024
@thecoolwinter
Copy link
Collaborator

@bombardier200 this might fix the issue you mentioned you noticed with the latest release.

@austincondiff austincondiff merged commit 1dd34c5 into CodeEditApp:main Jul 27, 2024
2 checks passed
plbstl added a commit to plbstl/CodeEdit that referenced this pull request Aug 19, 2024
allow files with a utType that is neither image nor PDF to be previewed (CodeEditApp#1822)
austincondiff pushed a commit that referenced this pull request Aug 21, 2024
…1820)

* add `updateStatusBarInfo` view modifier

* fix QuickLook previews in single file window

* change `fileURL` type to `NSURL` in `AnyFileView`

* fix QuickLook previews in Open Quickly

Use `dismantleNSView` in `AnyFileView` to prevent crashes when using Open Quickly.
What crashes?
1. When using Open Quickly without the workaround in `AnyFileView`, search for a media file (.png, .gif, .mp4, etc)
2. Press escape to close Open Quickly
3. re-open Open Quickly. The media preview is gone
4. Attempt to navigate upwards or downwards using the arrow buttons
5. A crash occurs (QuickLook is attempting to reuse an already closed preview)

* add assertionFailure in `CodeEditWindowController.openQuickly` for when an editorManager or statusBarViewModel is unavailable

* make `UpdateStatusBarInfo.fileURL` an optional

* remove the need to pass environment objects to `NonTextFileView`

This also prevents Open Quickly previews from updating the status bar

* rename function parameters in `UpdateStatusBarInfo` view modifier

* remove `updateStatusBarInfo` view extension

* remove guard in `CodeEditWindowController.openQuickly`

editorManager and statusBarViewModel environment objects are not used in Open Quickly anymore

* merge #1822 fix into this branch

allow files with a utType that is neither image nor PDF to be previewed (#1822)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants