Commit Diff


commit - 2ec74a9e9c334f3245765a6e6f35b7977f5b420e
commit + 602eda794f1d6ffa7bf52408686191499e971da3
blob - a6351da680ffacc2f47bf1a42b494d77af0b4a3a
blob + 59f6749677b14d49ad79028572ac387a766ff9db
--- tog/tog.c
+++ tog/tog.c
@@ -1288,7 +1288,7 @@ tog_resizeterm(void)
 }
 
 static const struct got_error *
-view_search_start(struct tog_view *view)
+view_search_start(struct tog_view *view, int fast_refresh)
 {
 	const struct got_error *err = NULL;
 	struct tog_view *v = view;
@@ -1321,6 +1321,8 @@ view_search_start(struct tog_view *view)
 	cbreak();
 	noecho();
 	nodelay(v->window, TRUE);
+	if (!fast_refresh)
+		halfdelay(10);
 	if (ret == ERR)
 		return NULL;
 
@@ -1488,7 +1490,7 @@ action_report(struct tog_view *view)
 
 static const struct got_error *
 view_input(struct tog_view **new, int *done, struct tog_view *view,
-    struct tog_view_list_head *views)
+    struct tog_view_list_head *views, int fast_refresh)
 {
 	const struct got_error *err = NULL;
 	struct tog_view *v;
@@ -1683,7 +1685,7 @@ view_input(struct tog_view **new, int *done, struct to
 	case '/':
 		view->count = 0;
 		if (view->search_start)
-			view_search_start(view);
+			view_search_start(view, fast_refresh);
 		else
 			err = view->input(new, view, ch);
 		break;
@@ -1775,7 +1777,7 @@ view_loop(struct tog_view *view)
 		if (fast_refresh && --fast_refresh == 0)
 			halfdelay(10); /* switch to once per second */
 
-		err = view_input(&new_view, &done, view, &views);
+		err = view_input(&new_view, &done, view, &views, fast_refresh);
 		if (err)
 			break;