diff --git a/src/winio.c b/src/winio.c
index fe54fa1e4ba34214aa830f7e23d2999383b1b4a7..8553d6640bcb89a18c7d79993b20bf437da894bd 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2531,7 +2531,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *def,
 #ifndef DISABLE_TABCOMP
 	    if (allow_tabs) {
 		answer = input_tab(answer, &statusbar_x, &tabbed, list);
-		statusbar_xend = statusbar_x;
+		statusbar_xend = strlen(answer);
 	    }
 	    break;
 #endif