mirror of
https://github.com/textmate/textmate.git
synced 2026-01-22 21:27:56 -05:00
Re-use file icon image
These are expensive to create and it was noticeable when lots of files matched and the menu had to be created (as it would when the user press a potential menu key like ⌘W).
This commit is contained in:
@@ -289,7 +289,7 @@ struct operation_t
|
||||
std::string const& title = doc->path() == NULL_STR ? doc->display_name() : path::relative_to(doc->path(), [[self rootPath] UTF8String]);
|
||||
NSString* shortcut = key < 11 ? [NSString stringWithFormat:@"%lu", (key++ % 10)] : @"";
|
||||
NSMenuItem* item = [menu addItemWithTitle:[NSString stringWithCxxString:title] action:@selector(selectMatchingPath:) keyEquivalent:shortcut];
|
||||
[item setIconForFile:match.path];
|
||||
[item setImage:match.icon];
|
||||
[item setRepresentedObject:match.path];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user