mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Changing BundleItemChooser’s hasSelection property now update item names
The items can be named “Do something with «unit» / Selection” and TextMate will show the proper title based on whether or not there is a selection, e.g. “Diff ▸ Document With Clipboard” versus “Diff ▸ Selection With Clipboard”. Previously though, the item titles were not re-generated when changing the hasSelection property, so the user could be presented with stale titles until some other action triggered re-generation, e.g. indicating that an adaptive item works on current line when there is a selection.
This commit is contained in:
@@ -694,6 +694,16 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
|
||||
[self updateItems:self];
|
||||
}
|
||||
|
||||
- (void)setHasSelection:(BOOL)flag
|
||||
{
|
||||
if(_hasSelection != flag)
|
||||
{
|
||||
_hasSelection = flag;
|
||||
_unfilteredItems = nil;
|
||||
[self updateItems:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setKeyEquivalentString:(NSString*)aString
|
||||
{
|
||||
if([_keyEquivalentString isEqualToString:aString])
|
||||
|
||||
Reference in New Issue
Block a user