• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

TextMate is a graphical text editor for OS X 10.7+


Commit MetaInfo

修訂fee36aaec98207fa1e8f25f6ac75b89d69d00635 (tree)
時間2012-08-18 22:30:23
作者Allan Odgaard <git@abet...>
CommiterAllan Odgaard

Log Message

Favorites prefixed with ‘[DIR]’ show folders within

For example if you have all your projects under ~/Projects then you can do:

mkdir -p ~/Library/Application\ Support/TextMate/Favorites
cd ~/Library/Application\ Support/TextMate/Favorites
ln -s ~/Projects "[DIR] My Projects"

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.

Change Summary

差異

--- a/Applications/TextMate/src/Favorites.mm
+++ b/Applications/TextMate/src/Favorites.mm
@@ -74,7 +74,21 @@
7474 citerate(entry, path::entries(favoritesPath))
7575 {
7676 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+ }
7892 }
7993 }
8094 return self;