From: wmorgan Date: Mon, 9 Jul 2007 23:25:12 +0000 (+0000) Subject: bugfix: tab (next new) doesn't scroll screen X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=c88a472f1888fc7a638fe83b53a8a2900d3f76dd;p=sup bugfix: tab (next new) doesn't scroll screen git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@493 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb index 11e463c..f6848a0 100644 --- a/lib/sup/modes/thread-index-mode.rb +++ b/lib/sup/modes/thread-index-mode.rb @@ -201,9 +201,10 @@ class ThreadIndexMode < LineCursorMode end def jump_to_next_new - n = ((curpos + 1) ... lines).find { |i| @threads[i].has_label? :unread } - n = (0 ... curpos).find { |i| @threads[i].has_label? :unread } unless n + n = ((curpos + 1) ... lines).find { |i| @threads[i].has_label? :unread } || (0 ... curpos).find { |i| @threads[i].has_label? :unread } if n + ## jump there if necessary + jump_to_line n unless n >= topline && n < botline set_cursor_pos n else BufferManager.flash "No new messages"