Skip to content

Commit

Permalink
Add continuous scrolling to line cursor mode
Browse files Browse the repository at this point in the history
Add continuous scrolling to line cursor mode

Do not move cursor if more lines do not exist (yet)

Revert "Do not move cursor if more lines do not exist (yet)"

This reverts commit 7539274.

Does not allow you to scroll to end of message.
  • Loading branch information
cscorley authored and gauteh committed Mar 23, 2014
1 parent e61c1b9 commit f31ee51
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions lib/sup/modes/line_cursor_mode.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,16 @@ 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
page_down
set_cursor_pos topline
if @curpos == botline - 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
else
@curpos += 1
unless buffer.dirty?
Expand All @@ -111,10 +118,15 @@ def cursor_down

def cursor_up
return false unless @curpos > @cursor_top
if @curpos == topline
old_topline = topline
page_up
set_cursor_pos [old_topline - 1, topline].max
if @curpos == topline + 3
jump_to_line topline - 1
@curpos -= 1
unless buffer.dirty?
draw_line @curpos + 1
draw_line @curpos
set_status
buffer.commit
end
else
@curpos -= 1
unless buffer.dirty?
Expand Down

0 comments on commit f31ee51

Please sign in to comment.