diff --git a/lib/sup.rb b/lib/sup.rb index 1bcab29c8..fbe1d6d4b 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -332,7 +332,8 @@ def load_config filename :slip_rows => 0, :col_jump => 2, :stem_language => "english", - :sync_back_to_maildir => false + :sync_back_to_maildir => false, + :continuous_scroll => false } if File.exists? filename config = Redwood::load_yaml_obj filename diff --git a/lib/sup/modes/line_cursor_mode.rb b/lib/sup/modes/line_cursor_mode.rb index ccea68456..17c9c8b23 100644 --- a/lib/sup/modes/line_cursor_mode.rb +++ b/lib/sup/modes/line_cursor_mode.rb @@ -94,7 +94,7 @@ def cursor_down call_load_more_callbacks buffer.content_height if @curpos >= lines - [buffer.content_height/2,1].max return false unless @curpos < lines - 1 - if @curpos == botline - 3 + if @curpos == botline - 3 and $config[:continuous_scroll] # load more lines, one at a time. jump_to_line topline + 1 @curpos += 1 @@ -104,6 +104,9 @@ def cursor_down set_status buffer.commit end + elsif @curpos >= botline - 1 + page_down + set_cursor_pos topline else @curpos += 1 unless buffer.dirty? @@ -118,7 +121,8 @@ def cursor_down def cursor_up return false unless @curpos > @cursor_top - if @curpos == topline + 3 + + if @curpos == topline + 3 and $config[:continuous_scroll] jump_to_line topline - 1 @curpos -= 1 unless buffer.dirty? @@ -127,6 +131,10 @@ def cursor_up set_status buffer.commit end + elsif @curpos == topline + old_topline = topline + page_up + set_cursor_pos [old_topline - 1, topline].max else @curpos -= 1 unless buffer.dirty? @@ -192,5 +200,4 @@ def call_load_more_callbacks size @load_more_q.push size if $config[:load_more_threads_when_scrolling] end end - end