-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add indication for externally deleted files #1999
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice, solid work! 🔥
@@ -57,7 +60,7 @@ struct EditorTabView: View { | |||
/// The item associated with the current tab. | |||
/// | |||
/// You can get tab-related information from here, like `label`, `icon`, etc. | |||
private var item: CEWorkspaceFile | |||
private let item: CEWorkspaceFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be an idea to rename this to something more descriptive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest my eye just got caught by the var
keyword, so I decided to change it to let
for the sake of its usage. But I'll push update on the name also – "item" is a no-go naming for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job Filipp! Just two suggestions 😁
/// | ||
/// Often returns ``FSEvent/changeInDirectory`` as `FSEventStream` returns | ||
/// Often returns ``[FSEvent/changeInDirectory]`` as `FSEventStream` returns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this sentence 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be loosing the other part of it on the next line 🙂
/// Often returns ``[FSEvent/changeInDirectory]`` as `FSEventStream` returns
/// `kFSEventStreamEventFlagNone (0x00000000)` frequently without more information.
This docstring was set before my changes, I only changed the type of returning value
func fileManagerUpdated(updatedItems: Set<CEWorkspaceFile>) { | ||
guard let parent = item.parent else { | ||
return | ||
} | ||
|
||
if updatedItems.contains(parent) { | ||
isDeleted = item.doesExist == false | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this can be simplified, and I’m fairly certain it should be updated on the main thread as well
func fileManagerUpdated(updatedItems: Set<CEWorkspaceFile>) { | |
guard let parent = item.parent else { | |
return | |
} | |
if updatedItems.contains(parent) { | |
isDeleted = item.doesExist == false | |
} | |
} | |
func fileManagerUpdated(updatedItems: Set<CEWorkspaceFile>) { | |
if let parent = item.parent, updatedItems.contains(parent) { | |
isDeleted = item.doesExist == false | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that depends on whether you are a fan of explicit guard
's everywhere (like me) or not. But I think you are right and semantics of your suggestion is more clean about the logic and intention of this block.
And of course main thread is a must – missing it was just my mistake.
b3d8a48
Implemented all suggested changes |
Description
Related Issues
Checklist
Screenshots
1936.mov