]> git.cworth.org Git - sup/blobdiff - lib/sup/buffer.rb
Merge branch 'ncurses-fixes'
[sup] / lib / sup / buffer.rb
index 5881febcf7e68c12df715d61baea7d05393232a9..4b53fed697b037656cdec013a64da1bb5e78f59c 100644 (file)
@@ -198,8 +198,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
@@ -268,9 +266,11 @@ EOS
 
     ## this magic makes Ncurses get the new size of the screen
     Ncurses.endwin
+    Ncurses.stdscr.keypad 1
+    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
 
@@ -479,7 +479,7 @@ EOS
     end
 
     if answer
-      answer = 
+      answer =
         if answer.empty?
           spawn_modal "file browser", FileBrowserMode.new
         elsif File.directory?(answer)
@@ -495,7 +495,7 @@ EOS
   ## returns an array of labels
   def ask_for_labels domain, question, default_labels, forbidden_labels=[]
     default_labels = default_labels - forbidden_labels - LabelManager::RESERVED_LABELS
-    default = default_labels.join(" ")
+    default = default_labels.to_a.join(" ")
     default += " " unless default.empty?
 
     # here I would prefer to give more control and allow all_labels instead of
@@ -506,7 +506,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!"
@@ -519,7 +519,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] }