InputText: Internal renaming of some fields + final copy uses edit_state.CurLenA+1 instead of buf_size.

This commit is contained in:
omar
2018-08-21 14:23:54 +02:00
parent 0fd6e9bc0d
commit 4de6e1f7e4
4 changed files with 30 additions and 29 deletions

View File

@ -2959,7 +2959,8 @@ struct ExampleAppConsole
// A better implementation would preserve the data on the current input line along with cursor position.
if (prev_history_pos != HistoryPos)
{
data->CursorPos = data->SelectionStart = data->SelectionEnd = data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
int sz = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
data->CursorPos = data->SelectionStart = data->SelectionEnd = data->BufTextLen = sz;
data->BufDirty = true;
}
}