From 597b2417b4b7d6ad180ab7a2c86c0d1204a3a14d Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Thu, 23 Jun 2016 00:19:58 +1200 Subject: [PATCH] debugimgui: don't add command to history if it's the same as the previous one --- src/osd/modules/debugger/debugimgui.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 3a20219fd51..d1f17e08114 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -39,6 +39,7 @@ public: this->m_machine = &machine; this->width = 300; this->height = 300; + this->console_prev.clear(); /* specials */ switch (type) @@ -78,6 +79,7 @@ public: int src_sel; char console_input[512]; std::vector console_history; + std::string console_prev; }; class debug_imgui : public osd_module, public debug_module @@ -465,7 +467,12 @@ void debug_imgui::handle_console(running_machine* machine) m_running = true; if(strcmp(view_main_console->console_input,"next") == 0) m_running = true; - view_main_console->console_history.push_back(std::string(view_main_console->console_input)); + // don't bother adding to history if the current command matches the previous one + if(view_main_console->console_prev != view_main_console->console_input) + { + view_main_console->console_history.push_back(std::string(view_main_console->console_input)); + view_main_console->console_prev = view_main_console->console_input; + } history_pos = view_main_console->console_history.size(); strcpy(view_main_console->console_input,""); view_main_console->exec_cmd = false;