]> git.cworth.org Git - sup/blobdiff - lib/sup/buffer.rb
Merge branch 'ncurses-fixes' into next
[sup] / lib / sup / buffer.rb
index f3b3cd5e7fd9cf1b5022303d1dc2668f3e3db8dd..7fa82d88bfdbd0a861a5e35bbe24aea8345a3348 100644 (file)
@@ -25,6 +25,8 @@ module Ncurses
   def mutex; @mutex ||= Mutex.new; end
   def sync &b; mutex.synchronize(&b); end
 
+  ## magically, this stuff seems to work now. i could swear it didn't
+  ## before. hm.
   def nonblocking_getch
     ## INSANTIY
     ## it is NECESSARY to wrap Ncurses.getch in a select() otherwise all
@@ -70,7 +72,7 @@ class Buffer
   def content_height; @height - 1; end
   def content_width; @width; end
 
-  def resize rows, cols
+  def resize rows, cols 
     return if cols == @width && rows == @height
     @width = cols
     @height = rows
@@ -198,8 +200,6 @@ EOS
     @in_x = ENV["TERM"] =~ /(xterm|rxvt|screen)/
     @sigwinch_happened = false
     @sigwinch_mutex = Mutex.new
-
-    self.class.i_am_the_instance self
   end
 
   def sigwinch_happened!; @sigwinch_mutex.synchronize { @sigwinch_happened = true } end
@@ -272,7 +272,7 @@ EOS
     Ncurses.curs_set 0
     Ncurses.refresh
     @sigwinch_mutex.synchronize { @sigwinch_happened = false }
-    Redwood::log "new screen size is #{Ncurses.rows} x #{Ncurses.cols}"
+    debug "new screen size is #{Ncurses.rows} x #{Ncurses.cols}"
 
     status, title = get_status_and_title(@focus_buf) # must be called outside of the ncurses lock
 
@@ -481,7 +481,7 @@ EOS
     end
 
     if answer
-      answer = 
+      answer =
         if answer.empty?
           spawn_modal "file browser", FileBrowserMode.new
         elsif File.directory?(answer)
@@ -508,7 +508,7 @@ EOS
 
     return unless answer
 
-    user_labels = answer.symbolistize
+    user_labels = answer.to_set_of_symbols
     user_labels.each do |l|
       if forbidden_labels.include?(l) || LabelManager::RESERVED_LABELS.include?(l)
         BufferManager.flash "'#{l}' is a reserved label!"
@@ -521,7 +521,7 @@ EOS
   def ask_for_contacts domain, question, default_contacts=[]
     default = default_contacts.map { |s| s.to_s }.join(" ")
     default += " " unless default.empty?
-    
+
     recent = Index.load_contacts(AccountManager.user_emails, :num => 10).map { |c| [c.full_address, c.email] }
     contacts = ContactManager.contacts.map { |c| [ContactManager.alias_for(c), c.full_address, c.email] }