Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
peach-html5-editor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d6b9400
)
page down key: cursor to end if scrolled bot already
author
Jason Woofenden
<jason@jasonwoof.com>
Wed, 30 Mar 2016 13:49:12 +0000
(09:49 -0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Wed, 30 Mar 2016 13:49:12 +0000
(09:49 -0400)
editor.coffee
patch
|
blob
|
history
diff --git
a/editor.coffee
b/editor.coffee
index
ef5d3a2
..
a7c3c66
100644
(file)
--- a/
editor.coffee
+++ b/
editor.coffee
@@
-1088,6
+1088,14
@@
class PeachHTML5Editor
screen_y = @cursor.y - @wrap2.scrollTop
scroll_amount = @wrap2_height - breathing_room
lowest_scrollpos = @wrap2.scrollHeight - @wrap2_height
screen_y = @cursor.y - @wrap2.scrollTop
scroll_amount = @wrap2_height - breathing_room
lowest_scrollpos = @wrap2.scrollHeight - @wrap2_height
+ if @wrap2.scrollTop is lowest_scrollpos # already at bottom
+ return unless @cursor?
+ # move cursor to bottom
+ new_cursor = last_cursor_position @tree
+ if new_cursor?
+ if new_cursor.n isnt @cursor.n or new_cursor.i isnt @cursor.i
+ @move_cursor new_cursor
+ return
@wrap2.scrollTop = Math.min lowest_scrollpos, @wrap2.scrollTop + scroll_amount
if @cursor?
@move_cursor_into_view screen_y + @wrap2.scrollTop
@wrap2.scrollTop = Math.min lowest_scrollpos, @wrap2.scrollTop + scroll_amount
if @cursor?
@move_cursor_into_view screen_y + @wrap2.scrollTop