Skip to content

Commit

Permalink
Fix autocomplete in console when semicolon present
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Nov 2, 2023
1 parent e7a173c commit 1941ee7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/c_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -2273,11 +2273,14 @@ bool C_Responder(event_t *ev)
|| (spaces1 == 2 && !endspace1 && (spaces2 == 2 || (spaces2 == 3 && endspace2)))
|| (spaces1 == 3 && !endspace1)))
{
char *temp = M_StringJoin(prefix, M_StringReplaceFirst(output, input, input), NULL);

C_AddToUndoHistory();
M_StringCopy(consoleinput, output, sizeof(consoleinput));
M_StringCopy(consoleinput, temp, sizeof(consoleinput));
caretpos = selectstart = selectend = len2 + (int)strlen(prefix);
caretwait = I_GetTimeMS() + CARETBLINKTIME;
showcaret = true;
free(temp);
return true;
}
}
Expand Down

0 comments on commit 1941ee7

Please sign in to comment.