From: William Morgan Date: Sun, 13 Jan 2008 05:48:36 +0000 (-0800) Subject: make 'n' and 'p' in thread-view-mode always top-and-left justify X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=0263bb808e03c8136d1f5e29434e7c068b84d179;p=sup make 'n' and 'p' in thread-view-mode always top-and-left justify Previously, 'n' and 'p' would only move the cursor if the next or previous message already completely fit on the screen. Now they always move the buffer so that the current message is at the top left. I think this makes it a little easier to read a whole thread, message by message. --- diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index 4f31338..d27323e 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -317,11 +317,11 @@ EOS left = l.depth * INDENT_SPACES right = left + l.width - ## jump to the top line unless both top and bottom fit in the current view - jump_to_line l.top unless l.top >= topline && l.top <= botline && l.bot >= topline && l.bot <= botline + ## jump to the top line + jump_to_line l.top - ## jump to the left columns unless both left and right fit in the current view - jump_to_col left unless left >= leftcol && left <= rightcol && right >= leftcol && right <= rightcol + ## jump to the left column + jump_to_col left ## either way, move the cursor to the first line set_cursor_pos l.top