[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] [PATCH] try loading ncursesw



---
 bin/sup           |   14 +++++++++++++-
 lib/sup/buffer.rb |    7 ++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/bin/sup b/bin/sup
index 471e833..fcc254f 100755
--- a/bin/sup
+++ b/bin/sup
@@ -1,7 +1,15 @@
 #!/usr/bin/env ruby
 
 require 'rubygems'
-require 'ncurses'
+
+no_ncursesw = false
+begin
+  require 'ncursesw'
+rescue LoadError
+  require 'ncurses'
+  no_ncursesw = true
+end
+
 require 'curses'
 require 'fileutils'
 require 'trollop'
@@ -21,6 +29,10 @@ EOS
   exit(-1)
 end
 
+if no_ncursesw
+  warn "Install the ncursesw gem for wide character support."
+end
+
 $opts = Trollop::options do
   version "sup v#{Redwood::VERSION}"
   banner <<EOS
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index df5d23c..e5175bb 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -1,6 +1,11 @@
 require 'etc'
 require 'thread'
-require 'ncurses'
+
+begin
+  require 'ncursesw'
+rescue LoadError
+  require 'ncurses'
+end
 
 if defined? Ncurses
 module Ncurses
-- 
1.6.0.4

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel