From mboxrd@z Thu Jan 1 00:00:00 1970 From: mailinglist@flasht.de (Christopher Bertels) Date: Fri, 05 Jun 2009 13:24:07 +0200 Subject: [sup-talk] Toggle expand/collapse of a message in threadview In-Reply-To: <1244199822-sup-1224@thinkpad-ubuntu> References: <1244150874-sup-6554@thinkpad-ubuntu> <1244172932-sup-1101@entry> <1244199822-sup-1224@thinkpad-ubuntu> Message-ID: <1244200965-sup-607@thinkpad-ubuntu> Ok, wasn't so hard. Here's the patch: diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index 2b6c58b..1e014c3 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -234,10 +234,12 @@ EOS ## view. def activate_chunk chunk = @chunk_lines[curpos] or return + move_to_next = false if chunk.is_a? Chunk::Text ## if the cursor is over a text region, expand/collapse the ## entire message chunk = @message_lines[curpos] + move_to_next = true end layout = if chunk.is_a?(Message) @layout[chunk] @@ -253,7 +255,7 @@ EOS end if chunk.is_a?(Message) jump_to_message chunk - jump_to_next_open + jump_to_next_open if move_to_next end end Excerpts from Christopher Bertels's message of Fr Jun 05 13:09:34 +0200 2009: > Actually, now that I've been using it a little more, I think it would be nicer > that when pressing enter on a collapsed message, the cursor would stay at the > header of that expanded message instead of moving to the next message header. > Right now, it's always moving to the next message, even when expanding a > collapsed > message to read it. > > Excerpts from William Morgan's message of Fr Jun 05 05:38:23 +0200 2009: > > Reformatted excerpts from Christopher Bertels's message of 2009-06-04: > > > Is there a way to expand/collsape the current message I'm reading when > > > in the middle of it? > > > > Good idea. I've changed this in git. Pressing enter on a text region now > > collapses the message. Behavior of enter on quotes, signatures, > > attachments, etc. is unchanged. > > > > Also, collapsing a message will make the cursor jump to the next open > > message. So you should be able to scan rapidly through a thread one > > message at a time by hitting enter to collapse it or 'n' to leave open. > > (And then 'p' and 'n' to review all open messages.) -- ================================ Christopher Bertels http://www.adztec-independent.de