]> git.cworth.org Git - sup/blobdiff - lib/sup/modes/line-cursor-mode.rb
Merge branch 'alignment-tweaks' into next
[sup] / lib / sup / modes / line-cursor-mode.rb
index 7fd55557bbb3428f34463afcd331f33627cc0ff7..246f2b5461c69a7a53241d237fa7a647d14371fc 100644 (file)
@@ -55,14 +55,11 @@ protected
     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