lib/sup/modes/line-cursor-mode.rb in sup-0.3 vs lib/sup/modes/line-cursor-mode.rb in sup-0.4
- old
+ new
@@ -53,17 +53,14 @@
return if @curpos == p
@curpos = p.clamp @cursor_top, lines
buffer.mark_dirty
end
- ## override search behavior to be cursor-based
+ ## override search behavior to be cursor-based. this is a stupid
+ ## implementation and should be made better. TODO: improve.
def search_goto_line line
- while line > botline
- page_down
- end
- while line < topline
- page_up
- end
+ page_down while line >= botline
+ page_up while line < topline
set_cursor_pos line
end
def search_start_line; @curpos end