lib/sup/modes/line_cursor_mode.rb in sup-0.16.0 vs lib/sup/modes/line_cursor_mode.rb in sup-0.17.0

- old
+ new

@@ -92,11 +92,21 @@ 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 - 1 + if $config[:continuous_scroll] and (@curpos == botline - 3 and @curpos < lines - 3) + # load more lines, one at a time. + jump_to_line topline + 1 + @curpos += 1 + unless buffer.dirty? + draw_line @curpos - 1 + draw_line @curpos + set_status + buffer.commit + end + elsif @curpos >= botline - 1 page_down set_cursor_pos topline else @curpos += 1 unless buffer.dirty? @@ -109,11 +119,21 @@ true end def cursor_up return false unless @curpos > @cursor_top - if @curpos == topline + + if $config[:continuous_scroll] and (@curpos == topline + 2) + jump_to_line topline - 1 + @curpos -= 1 + unless buffer.dirty? + draw_line @curpos + 1 + draw_line @curpos + set_status + buffer.commit + end + elsif @curpos == topline old_topline = topline page_up set_cursor_pos [old_topline - 1, topline].max else @curpos -= 1 @@ -178,7 +198,6 @@ def call_load_more_callbacks size @load_more_q.push size if $config[:load_more_threads_when_scrolling] end end - end