Skip to content

Commit 1941ee7

Browse files
committed
Fix autocomplete in console when semicolon present
1 parent e7a173c commit 1941ee7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/c_console.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -2273,11 +2273,14 @@ bool C_Responder(event_t *ev)
22732273
|| (spaces1 == 2 && !endspace1 && (spaces2 == 2 || (spaces2 == 3 && endspace2)))
22742274
|| (spaces1 == 3 && !endspace1)))
22752275
{
2276+
char *temp = M_StringJoin(prefix, M_StringReplaceFirst(output, input, input), NULL);
2277+
22762278
C_AddToUndoHistory();
2277-
M_StringCopy(consoleinput, output, sizeof(consoleinput));
2279+
M_StringCopy(consoleinput, temp, sizeof(consoleinput));
22782280
caretpos = selectstart = selectend = len2 + (int)strlen(prefix);
22792281
caretwait = I_GetTimeMS() + CARETBLINKTIME;
22802282
showcaret = true;
2283+
free(temp);
22812284
return true;
22822285
}
22832286
}

0 commit comments

Comments
 (0)