TextMate is a graphical text editor for OS X 10.7+
修訂 | fee36aaec98207fa1e8f25f6ac75b89d69d00635 (tree) |
---|---|
時間 | 2012-08-18 22:30:23 |
作者 | Allan Odgaard <git@abet...> |
Commiter | Allan Odgaard |
Favorites prefixed with ‘[DIR]’ show folders within
For example if you have all your projects under ~/Projects then you can do:
This will then have all the folders inside ~/Projects show when you choose Open Favorites… (⇧⌘O).
Long-term it might be useful to store actual property lists in the favorites folder, akin to smart folders (i.e. describe a query for what to show) and/or allow descending into the folders shown in the ⇧⌘O window.
@@ -74,7 +74,21 @@ | ||
74 | 74 | citerate(entry, path::entries(favoritesPath)) |
75 | 75 | { |
76 | 76 | if((*entry)->d_type == DT_LNK) |
77 | - favorites.insert(std::make_pair((*entry)->d_name, path::resolve(path::join(favoritesPath, (*entry)->d_name)))); | |
77 | + { | |
78 | + std::string const& path = path::resolve(path::join(favoritesPath, (*entry)->d_name)); | |
79 | + if(strncmp("[DIR] ", (*entry)->d_name, 6) == 0) | |
80 | + { | |
81 | + citerate(subentry, path::entries(path)) | |
82 | + { | |
83 | + if((*subentry)->d_type == DT_DIR) | |
84 | + favorites.insert(std::make_pair(text::format("%s — %s", (*subentry)->d_name, (*entry)->d_name + 6), path::join(path, (*subentry)->d_name))); | |
85 | + } | |
86 | + } | |
87 | + else | |
88 | + { | |
89 | + favorites.insert(std::make_pair((*entry)->d_name, path)); | |
90 | + } | |
91 | + } | |
78 | 92 | } |
79 | 93 | } |
80 | 94 | return self; |