diff --git a/search.c b/search.c
index 3dcc223fa22dc959c194acce0925a8be3498510b..569e063798c171a881b751c070a5b01bc540c4f3 100644
--- a/search.c
+++ b/search.c
@@ -461,10 +461,8 @@ int do_replace_loop(char *prevanswer, filestruct *begin, int *beginx,
 	fileptr = findnextstr(replaceall, begin, *beginx, prevanswer);
 
 	/* No more matches.  Done! */
-	if (!fileptr) {
-	    wrefresh(edit);
+	if (!fileptr)
 	    break;
-	}
 
 	/* Make sure only wholewords are found */
 	if (wholewords)
diff --git a/winio.c b/winio.c
index 8e78e4c711c7a65b6fd8582d26e72fddf970b1c5..15a6045cd9fd9876cced34acbe39470ca4576499 100644
--- a/winio.c
+++ b/winio.c
@@ -263,6 +263,9 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
 
     nanoget_repaint(buf, inputbuf, x);
 
+    /* Make sure any editor screen updates are displayed before getting input */
+    wrefresh(edit);
+
     while ((kbinput = wgetch(bottomwin)) != 13) {
 	for (j = 0; j <= slen - 1; j++) {
 	    if (kbinput == s[j].val) {