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
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