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

Partial? Fix for panic when opening binary files #220

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

wilsonk
Copy link
Collaborator

@wilsonk wilsonk commented Oct 28, 2024

Not completely sure if this the right way to do this, but it seems to work for the few file types I have tested and directories (that is part of the problem...we may want to be able to traverse directories?). Anyways, nothing happens if you try to choose a binary/non-text file to open.

Perhaps we should also change the 'Search:' line to a different color, or show some indication that the open failed?

Fixes(kindof) #191 (LIL-59)

@tauraamui
Copy link
Owner

tauraamui commented Oct 28, 2024

I'm about to go to bed, but I'm sure this is fine for now (I'll double check tomorrow). I'd like to refer you to this open branch tho, https://github.com/tauraamui/lilly/tree/spike/investigate-file-encodings/encoding-test this is a collection files of which 99% of will fatal crash Lilly on open, due to rendering problem. However, I think the default behaviour of Lilly should be to reject or refuse to open any file whose encoding it is unable to infer from a BOM or otherwise, eg., anything outside of all major encoding present in that examples directory.

Our inability to render these documents is a separate issue, in the meantime we should eventually add some kind of file inspection stage to loading a workspace where we ahead of time identify each files encoding type, and based on this we either:

  • just exclude files from the list (I don't like that idea)
  • make them disabled entries in the list, ie., you can't open them
  • or some kind of error output response on attempt to open them

@wilsonk
Copy link
Collaborator Author

wilsonk commented Oct 28, 2024

I definitely like option 2 of those options (disabled entries). I will check out that branch also.

Copy link
Owner

@tauraamui tauraamui left a comment

Choose a reason for hiding this comment

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

middle-swear-tease

@wilsonk wilsonk merged commit 2fba5b3 into master Oct 29, 2024
1 check passed
@tauraamui tauraamui deleted the fix-panic-opening-binary branch October 29, 2024 11:46
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.

2 participants