Commit 7d049c1829b4f9b4a2bcda7143ffbb922b0987cc

Stefan Sperling 2019-08-22T00:42:19

tog: fix search prompt location in split-screen view

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/tog/tog.c b/tog/tog.c
index 45b73f1..d1997e2 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -539,12 +539,15 @@ view_search_start(struct tog_view *view)
 	const struct got_error *err = NULL;
 	char pattern[1024];
 	int ret;
+	int begin_x = 0;
 
 	if (view->nlines < 1)
 		return NULL;
 
+	if (!view_is_parent_view(view))
+		begin_x = view_split_begin_x(view->begin_x);
 	mvwaddstr(view->window, view->begin_y + view->nlines - 1,
-	    view->begin_x, "/");
+	    begin_x, "/");
 	wclrtoeol(view->window);
 
 	nocbreak();