Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] [PATCH] don't try to open the next thread if there isn't one available
@ 2008-01-30  8:21 Jeff Balogh
  2008-01-30 15:43 ` John Bent
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jeff Balogh @ 2008-01-30  8:21 UTC (permalink / raw)


When you're on the last thread of a ThreadSet and press ',<key>',
nothing happens, but you can't '.<key>' since @dying == true.  This
patch changes :next to :kill if there is no next thread.
---
I usually traverse my inbox with ',a', so it annoys me when sup gets stuck on
the last thread.  This patch implements what I expect to happen: the thread is
killed and the previous buffer pops up.

 lib/sup/modes/thread-index-mode.rb |    4 ++++
 lib/sup/modes/thread-view-mode.rb  |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
index 7686098..d6c1b21 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -121,6 +121,10 @@ EOS
 
     select t, b
   end
+
+  def has_thread_after thread
+      @lines[thread] < @threads.length - 1
+  end
   
   def handle_single_message_labeled_update sender, m
     ## no need to do anything different here; we don't differentiate 
diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb
index 961fc5d..e79e410 100644
--- a/lib/sup/modes/thread-view-mode.rb
+++ b/lib/sup/modes/thread-view-mode.rb
@@ -416,6 +416,8 @@ EOS
     return if @dying
     @dying = true
 
+    op = :kill unless @index_mode.has_thread_after(@thread)
+
     case op
     when :next
       @index_mode.launch_next_thread_after(@thread) do
-- 
1.5.3.7



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-06 16:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-30  8:21 [sup-talk] [PATCH] don't try to open the next thread if there isn't one available Jeff Balogh
2008-01-30 15:43 ` John Bent
2008-02-05 17:27   ` William Morgan
2008-02-06 16:21     ` John Bent
2008-01-30 23:05 ` Jeff Balogh
2008-02-03  4:35   ` William Morgan
2008-02-03  4:31 ` William Morgan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox