Commit Diff


commit - 0e49c9bbcbfef05d5bdf9ad6d851f51fe25c2eaa
commit + 2ef8fcaedd93b1a56d0940ddd58a43a6d6c321f0
blob - 463214cefab5e85af06151bd52e9f2946ceb7dd9
blob + c7c260c7ee8da4cf04fe468f2a7fc52eac4f45fd
--- ui.c
+++ ui.c
@@ -145,7 +145,6 @@ set_scroll_position(struct tab *tab, size_t top, size_
 		}
 
 		if (!curfound && i == cur) {
-			curfound = 1;
 			tab->buffer.current_line = vl;
 			return;
 		}
@@ -155,6 +154,9 @@ set_scroll_position(struct tab *tab, size_t top, size_
 		tab->buffer.top_line = TAILQ_FIRST(&tab->buffer.head);
 		tab->buffer.current_line = tab->buffer.top_line;
 	}
+
+	if (!curfound)
+		tab->buffer.current_line = tab->buffer.top_line;
 }
 
 void