]> git.notmuchmail.org Git - sup/commitdiff
bugfix for in-buffer search: corner case for results on last line
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 27 Dec 2007 22:07:03 +0000 (14:07 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Thu, 27 Dec 2007 22:07:03 +0000 (14:07 -0800)
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