]> git.cworth.org Git - sup/commitdiff
make 'n' and 'p' in thread-view-mode always top-and-left justify
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 13 Jan 2008 05:48:36 +0000 (21:48 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sun, 13 Jan 2008 05:48:36 +0000 (21:48 -0800)
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.

lib/sup/modes/thread-view-mode.rb

index 4f313386d5afe0cd077fc1464e275fcef61a3b8b..d27323e06704d78dcf71212853eb58cffcdf6f84 100644 (file)
@@ -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