debugimgui: when using history, set the cursor position to the end of the text

This commit is contained in:
mahlemiut 2016-06-20 14:39:23 +12:00
parent 6ae599f4cc
commit 59d73876fb

View File

@ -490,9 +490,9 @@ int debug_imgui::history_set(ImGuiTextEditCallbackData* data)
}
if(history_pos == view_main_console->console_history.size())
data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", "");
data->CursorPos = data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", "");
else
data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", view_main_console->console_history[history_pos].c_str());
data->CursorPos = data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", view_main_console->console_history[history_pos].c_str());
data->BufDirty = true;
return 0;