]> git.cworth.org Git - sup/commitdiff
bugfix: jump_to_first_open
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 18 Jan 2007 01:50:45 +0000 (01:50 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Thu, 18 Jan 2007 01:50:45 +0000 (01:50 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@263 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/modes/thread-index-mode.rb
lib/sup/modes/thread-view-mode.rb

index cbfd413fa358e17eeec7dfa3b3d58b1cf09825f0..c6baa531933e236bd151aeff24b23c9031854bc3 100644 (file)
@@ -61,7 +61,7 @@ class ThreadIndexMode < LineCursorMode
       mode = ThreadViewMode.new t, @hidden_labels
       BufferManager.spawn t.subj, mode
       BufferManager.draw_screen
-      mode.jump_to_next_open
+      mode.jump_to_first_open
       BufferManager.draw_screen # lame TODO: make this unnecessary
       ## the first draw_screen is needed before topline and botline
       ## are set, and the second to show the cursor having moved
index 3c02dc74c0a2625cc86d3b551d7941bed9fc3f4f..57d3de4abd9acc1fde7e2c3d395f1b6171444b72 100644 (file)
@@ -168,10 +168,19 @@ class ThreadViewMode < LineCursorMode
     end
   end
 
+  def jump_to_first_open
+    m = @message_lines[0] or return
+    if @layout[m].state != :closed
+      jump_to_message m
+    else
+      jump_to_next_open
+    end
+  end
+
   def jump_to_next_open
     m = @message_lines[curpos] or return
     while nextm = @layout[m].next
-      break if @layout[nextm].state == :open
+      break if @layout[nextm].state != :closed
       m = nextm
     end
     jump_to_message nextm if nextm