mirror of https://github.com/stella-emu/stella.git
added clearHistory command for PromptWidget (see #240)
This commit is contained in:
parent
b8ed09695f
commit
6172943aaf
|
@ -936,6 +936,7 @@ Type "help 'cmd'" to see extended information about the given command.</p>
|
||||||
cheat - Use a cheat code (see manual for cheat types)
|
cheat - Use a cheat code (see manual for cheat types)
|
||||||
clearBreaks - Clear all breakpoints
|
clearBreaks - Clear all breakpoints
|
||||||
clearConfig - Clear DiStella config directives [bank xx]
|
clearConfig - Clear DiStella config directives [bank xx]
|
||||||
|
clearHistory - Clear the prompt history
|
||||||
clearSaveStateIfs - Clear all saveState points
|
clearSaveStateIfs - Clear all saveState points
|
||||||
clearTraps - Clear all traps
|
clearTraps - Clear all traps
|
||||||
clearWatches - Clear all watches
|
clearWatches - Clear all watches
|
||||||
|
|
|
@ -950,6 +950,14 @@ void DebuggerParser::executeClearConfig()
|
||||||
commandResult << debugger.cartDebug().clearConfig();
|
commandResult << debugger.cartDebug().clearConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
// "clearHistory"
|
||||||
|
void DebuggerParser::executeClearHistory()
|
||||||
|
{
|
||||||
|
debugger.prompt().clearHistory();
|
||||||
|
commandResult << "";
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
// "clearBreaks"
|
// "clearBreaks"
|
||||||
void DebuggerParser::executeClearSaveStateIfs()
|
void DebuggerParser::executeClearSaveStateIfs()
|
||||||
|
@ -2600,6 +2608,16 @@ DebuggerParser::CommandArray DebuggerParser::commands = { {
|
||||||
std::mem_fn(&DebuggerParser::executeClearConfig)
|
std::mem_fn(&DebuggerParser::executeClearConfig)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"clearHistory",
|
||||||
|
"Clear the prompt history",
|
||||||
|
"Example: clearhisotry (no parameters)",
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
{ Parameters::ARG_END_ARGS },
|
||||||
|
std::mem_fn(&DebuggerParser::executeClearHistory)
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"clearSaveStateIfs",
|
"clearSaveStateIfs",
|
||||||
"Clear all saveState points",
|
"Clear all saveState points",
|
||||||
|
|
|
@ -101,7 +101,7 @@ class DebuggerParser
|
||||||
std::array<Parameters, 10> parms;
|
std::array<Parameters, 10> parms;
|
||||||
std::function<void (DebuggerParser*)> executor;
|
std::function<void (DebuggerParser*)> executor;
|
||||||
};
|
};
|
||||||
using CommandArray = std::array<Command, 101>;
|
using CommandArray = std::array<Command, 102>;
|
||||||
static CommandArray commands;
|
static CommandArray commands;
|
||||||
|
|
||||||
struct Trap
|
struct Trap
|
||||||
|
@ -159,6 +159,7 @@ class DebuggerParser
|
||||||
void executeCheat();
|
void executeCheat();
|
||||||
void executeClearBreaks();
|
void executeClearBreaks();
|
||||||
void executeClearConfig();
|
void executeClearConfig();
|
||||||
|
void executeClearHistory();
|
||||||
void executeClearSaveStateIfs();
|
void executeClearSaveStateIfs();
|
||||||
void executeClearTraps();
|
void executeClearTraps();
|
||||||
void executeClearWatches();
|
void executeClearWatches();
|
||||||
|
|
|
@ -966,6 +966,13 @@ void PromptWidget::clearScreen()
|
||||||
resetFunctions();
|
resetFunctions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void PromptWidget::clearHistory()
|
||||||
|
{
|
||||||
|
_history.clear();
|
||||||
|
_historyIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PromptWidget::resetFunctions()
|
void PromptWidget::resetFunctions()
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,8 +46,10 @@ class PromptWidget : public Widget, public CommandSender
|
||||||
void printPrompt();
|
void printPrompt();
|
||||||
string saveBuffer(const FilesystemNode& file);
|
string saveBuffer(const FilesystemNode& file);
|
||||||
|
|
||||||
// Clear screen and erase all history
|
// Clear screen
|
||||||
void clearScreen();
|
void clearScreen();
|
||||||
|
// Erase all history
|
||||||
|
void clearHistory();
|
||||||
|
|
||||||
void addToHistory(const char *str);
|
void addToHistory(const char *str);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue