sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit d03007cfcd87e6c0ad855a82cc4b583f8dcf534b
parent ca49d467ac8b90116b62c1b12ad009b90100603a
Author: Zeger-Jan van de Weg <mail@zjvandeweg.nl>
Date:   Wed,  8 Apr 2015 20:49:22 +0200

ancestors are built in, now also checks Kernel and BasicObject for keymaps

Diffstat:
M lib/sup/mode.rb | 4 ++--
M lib/sup/util.rb | 11 -----------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/lib/sup/mode.rb b/lib/sup/mode.rb
@@ -46,7 +46,7 @@ class Mode
   end
 
   def resolve_input c
-    ancestors.each do |klass| # try all keymaps in order of ancestry
+    self.class.ancestors.each do |klass| # try all keymaps in order of ancestry
       next unless @@keymaps.member?(klass)
       action = BufferManager.resolve_input_with_keymap c, @@keymaps[klass]
       return action if action
@@ -62,7 +62,7 @@ class Mode
 
   def help_text
     used_keys = {}
-    ancestors.map do |klass|
+    self.class.ancestors.map do |klass|
       km = @@keymaps[klass] or next
       title = "Keybindings from #{Mode.make_name klass.name}"
       s = <<EOS
diff --git a/lib/sup/util.rb b/lib/sup/util.rb
@@ -182,17 +182,6 @@ class Module
 end
 
 class Object
-  def ancestors
-    ret = []
-    klass = self.class
-
-    until klass == Object
-      ret << klass
-      klass = klass.superclass
-    end
-    ret
-  end
-
   ## "k combinator"
   def returning x; yield x; x; end