+- (void)outlineViewItemDidExpand:(NSNotification *)notification {
+ id <NJInputPathElement> item = notification.userInfo[@"NSObject"];
+ NSString *uid = item.uid;
+ if (![_expanded containsObject:uid])
+ [_expanded addObject:uid];
+ while (_expanded.count > EXPANDED_MEMORY_MAX_SIZE)
+ [_expanded removeObjectAtIndex:0];
+ [NSUserDefaults.standardUserDefaults setObject:_expanded
+ forKey:@"expanded rows"];
+}
+
+- (void)outlineViewItemDidCollapse:(NSNotification *)notification {
+ id <NJInputPathElement> item = notification.userInfo[@"NSObject"];
+ [_expanded removeObject:item.uid];
+ [NSUserDefaults.standardUserDefaults setObject:_expanded
+ forKey:@"expanded rows"];
+}
+