mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Skip reloading file browser items if items are unchanged
The comparison is somewhat shallow, but ideally all changes to the actual items (rather than adding or removing items) is done by updating the properties of the existing instance. The exception here is the SCM Status data source, but FSItem’s isEqual: method does compare scmStatus.
This commit is contained in:
@@ -432,9 +432,8 @@ struct expansion_state_t
|
||||
++state->requests;
|
||||
|
||||
[_dataSource reloadItem:item completionHandler:^(NSArray* children){
|
||||
// The reason we continue even with no changes is that icon updates (SCM status) are not reflected by `hasChanges`
|
||||
BOOL hasChanges = !item.children || ![item.children isEqualToArray:children];
|
||||
if(!state->stop && ([_outlineView editedRow] == -1 || hasChanges))
|
||||
if(!state->stop && hasChanges)
|
||||
{
|
||||
NSIndexSet* indexSet = [_outlineView selectedRowIndexes];
|
||||
for(NSUInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex:index])
|
||||
|
||||
Reference in New Issue
Block a user