plugins/textmate/lib/textmate.rb in redcar-0.3.4.3 vs plugins/textmate/lib/textmate.rb in redcar-0.3.5
- old
+ new
@@ -9,29 +9,10 @@
module Textmate
def self.all_bundle_paths
Dir[File.join(Redcar.root, "textmate", "Bundles", "*")]
end
- def self.attach_menus(builder)
- s = Time.now
- @menus ||= begin
- Menu::Builder.build do |a|
- all_bundles.sort_by {|b| (b.name||"").downcase}.each do |bundle|
- bundle.build_menu(a)
- end
- end
- end
- @menus.entries.each {|i| builder.append(i) }
- puts "took #{Time.now - s}s to attach bundle menus"
- end
-
- #def self.attach_keybindings(builder)
- # s = Time.now
- # all_bundles
- # puts "took #{Time.now - s}s to attach bundle menus"
- #end
-
def self.uuid_hash
@uuid_hash ||= begin
h = {}
all_bundles.each do |b|
h[b.uuid] = b
@@ -40,10 +21,21 @@
end
h
end
end
+ def self.attach_menus(builder)
+ #@menus ||= begin
+ # Menu::Builder.build do |a|
+ # all_bundles.sort_by {|b| (b.name||"").downcase}.each do |bundle|
+ # bundle.build_menu(a)
+ # end
+ # end
+ #end
+ #@menus.entries.each {|i| builder.append(i) }
+ end
+
def self.all_bundles
@all_bundles ||= begin
cache = PersistentCache.new("textmate_bundles")
cache.cache do
all_bundle_paths.map {|path| Bundle.new(path) }
@@ -61,11 +53,15 @@
@all_settings ||= begin
all_bundles.map {|b| b.preferences }.flatten.map {|p| p.settings}.flatten
end
end
- # Translates a Textmate key equivalent into a Redcar
- # keybinding.
+ def self.settings(type=nil)
+ @all_settings_by_type ||= {}
+ @all_settings_by_type[type] ||= all_settings.select {|s| s.is_a?(type) }
+ end
+
+ # Translates a Textmate key equivalent into a Redcar keybinding.
def self.translate_key_equivalent(keyeq, name=nil)
if keyeq
key_str = keyeq[-1..-1]
case key_str
when "\n"