MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / HistoryKeyCallback

Method HistoryKeyCallback

src/app/imgui_console.cpp:394–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394int ImGui_Console::HistoryKeyCallback(ImGuiInputTextCallbackData* data)
395{
396 HistoryBuffer::reverse_iterator currentPos = m_HistoryIterator;
397 switch (data->EventKey)
398 {
399 case ImGuiKey_UpArrow: ++m_HistoryIterator; break;
400 case ImGuiKey_DownArrow: --m_HistoryIterator; break;
401 default: break;
402 }
403 if (currentPos != m_HistoryIterator)
404 {
405 std::string const& cmd = *m_HistoryIterator;
406 snprintf(data->Buf, data->BufSize, "%s", cmd.c_str());
407 data->BufTextLen = (int)cmd.length();
408 data->BufDirty = true;
409 }
410 return 0;
411}
412
413int ImGui_Console::TextEditCallback(ImGuiInputTextCallbackData* data)
414{

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected