CodeEditApp/CodeEdit

๐Ÿž Source editor disappears when deleting all text

austincondiff opened this issue ยท 8 comments

Description

Deleting all text from the source editor results in the source editor being replaced by a QuickLook view.

To Reproduce

  1. Open a project
  2. Open a file in the project
  3. Delete all of the text in the file
  4. Notice the source editor is replaced by a big file icon (QuickLook view)

Expected Behavior

The source editor should remain in place.

Screenshots

Screen.Recording.2024-05-17.at.2.59.54.PM.mov

Related issues

@plbstl I believe this was introduced in your recent PR #1707. Would you be able to take a look at this one?

I see. I'm taking a look at it now

Whoops, didn't see @plbstl was taking a look. I've got a PR open for this now it was a very small fix.

Oh okay. I'll also test it out

I found some issues with #1723.

Doesn't work for:

  • files without file extensions
  • files with only file extensions

Also, it opens some binaries as text files.

pr-1723.mov

This is what #1724 looks like:

pr-1724.mov

Good catch, does this PR replace the other one entirely?

Yes it does. They are both minor changes.