summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/debugimgui.cpp
diff options
context:
space:
mode:
author mahlemiut <bsr@xnet.co.nz>2016-06-23 00:19:58 +1200
committer mahlemiut <bsr@xnet.co.nz>2016-06-23 00:20:48 +1200
commit597b2417b4b7d6ad180ab7a2c86c0d1204a3a14d (patch)
treecfdfdb5d1310102eb1587da67c69c7483222ed47 /src/osd/modules/debugger/debugimgui.cpp
parent8b660ff62e792ed9cdd90d4807e0ebee67562897 (diff)
debugimgui: don't add command to history if it's the same as the previous one
Diffstat (limited to 'src/osd/modules/debugger/debugimgui.cpp')
-rw-r--r--src/osd/modules/debugger/debugimgui.cpp9
1 files changed, 8 insertions, 1 deletions
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<std::string> 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;