From: wmorgan Date: Mon, 10 Dec 2007 06:33:56 +0000 (+0000) Subject: make edit-message-mode every so slightly less hideously ugly X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e1750c0ec032b48d79947c7358a568d5aa52a8b5;p=sup make edit-message-mode every so slightly less hideously ugly git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@764 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/horizontal-selector.rb b/lib/sup/horizontal-selector.rb index 8ef30fe..aef16d4 100644 --- a/lib/sup/horizontal-selector.rb +++ b/lib/sup/horizontal-selector.rb @@ -16,25 +16,6 @@ class HorizontalSelector def val; @vals[@selection] end - def old_line width=nil - label = - if width - sprintf "%#{width}s ", @label - else - "#{@label} " - end - - [[:none, label]] + - (0 ... @labels.length).inject([]) do |array, i| - array + [ - if i == @selection - [@selected_color, "[" + @labels[i] + "]"] - else - [@base_color, " " + @labels[i] + " "] - end] + [[:none, " "]] - end + [[:none, ""]] - end - def line width=nil label = if width @@ -43,15 +24,15 @@ class HorizontalSelector "#{@label} " end - [[:none, label]] + + [[@base_color, label]] + (0 ... @labels.length).inject([]) do |array, i| array + [ if i == @selection [@selected_color, @labels[i]] else [@base_color, @labels[i]] - end] + [[:none, " "]] - end + [[:none, ""]] + end] + [[@base_color, " "]] + end + [[@base_color, ""]] end def roll_left diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb index 78e8896..fa34790 100644 --- a/lib/sup/modes/edit-message-mode.rb +++ b/lib/sup/modes/edit-message-mode.rb @@ -94,7 +94,7 @@ EOS elsif i < @selectors.length @selectors[i].line @selector_label_width elsif i == @selectors.length - "-" * buffer.content_width + "" else @text[i - @selectors.length - DECORATION_LINES] end