]> git.cworth.org Git - sup/commitdiff
slight rejiggering of display to handle long buffer names
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 1 Dec 2006 19:19:53 +0000 (19:19 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Fri, 1 Dec 2006 19:19:53 +0000 (19:19 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@54 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/buffer-list-mode.rb

index 76d8c0309ac818af0dfe77500cc5bee26059da47..a830b8ecdb0327a5548bb3c58409d9d5b0dbf57b 100644 (file)
@@ -2,8 +2,8 @@ module Redwood
 
 class BufferListMode < LineCursorMode
   register_keymap do |k|
-    k.add :jump_to_buffer, "Jump to that buffer", :enter
-    k.add :reload, "Reload", "R"
+    k.add :jump_to_buffer, "Jump to selected buffer", :enter
+    k.add :reload, "Reload buffer list", "R"
   end
 
   def initialize
@@ -23,9 +23,9 @@ protected
 
   def regen_text
     @bufs = BufferManager.buffers.sort_by { |name, buf| name }
-    width = @bufs.map { |name, buf| name.length }.max
+    width = @bufs.map { |name, buf| buf.mode.name.length }.max
     @text = @bufs.map do |name, buf|
-      sprintf "%#{width}s  %s", name, buf.mode.name
+      sprintf "%#{width}s  %s", buf.mode.name, name
     end
   end