]> git.cworth.org Git - sup/blobdiff - lib/sup.rb
Merge branch 'default-colors' into next
[sup] / lib / sup.rb
index fe78bcb172eb9ceda46ba4601cf26aae62fed8d7..f855964151863f8a29bc18b43cb9e2952e894fda 100644 (file)
@@ -6,6 +6,19 @@ require 'fileutils'
 require 'gettext'
 require 'curses'
 
+## the following magic enables wide characters when used with a ruby
+## ncurses.so that's been compiled against libncursesw. (note the w.) why
+## this works, i have no idea. much like pretty much every aspect of
+## dealing with curses.  cargo cult programming at its best.
+
+require 'dl/import'
+module LibC
+  extend DL::Importable
+  dlload Config::CONFIG['arch'] =~ /darwin/ ? "libc.dylib" : "libc.so.6"
+  extern "void setlocale(int, const char *)"
+end
+LibC.setlocale(6, "")  # LC_ALL == 6
+
 class Object
   ## this is for debugging purposes because i keep calling #id on the
   ## wrong object and i want it to throw an exception
@@ -112,6 +125,7 @@ module Redwood
     Redwood::PollManager.new
     Redwood::SuicideManager.new Redwood::SUICIDE_FN
     Redwood::CryptoManager.new
+    Redwood::UndoManager.new
   end
 
   def finish
@@ -208,6 +222,7 @@ else
     :confirm_no_attachments => true,
     :confirm_top_posting => true,
     :discard_snippets_from_encrypted_messages => false,
+    :default_attachment_save_dir => "",
   }
   begin
     FileUtils.mkdir_p Redwood::BASE_DIR
@@ -268,6 +283,7 @@ require "sup/tagger"
 require "sup/draft"
 require "sup/poll"
 require "sup/crypto"
+require "sup/undo"
 require "sup/horizontal-selector"
 require "sup/modes/line-cursor-mode"
 require "sup/modes/help-mode"