mirror of https://github.com/stella-emu/stella.git
add commands from 'exec' script to prompt history
This commit is contained in:
parent
0049a968bb
commit
b1f841cccc
|
@ -1177,9 +1177,16 @@ void DebuggerParser::executeExec()
|
||||||
<< uInt32(TimerManager::getTicks()/1000);
|
<< uInt32(TimerManager::getTicks()/1000);
|
||||||
execPrefix = prefix.str();
|
execPrefix = prefix.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make sure the commands are added to prompt history
|
||||||
|
StringList history;
|
||||||
|
|
||||||
++execDepth;
|
++execDepth;
|
||||||
commandResult << exec(node);
|
commandResult << exec(node, &history);
|
||||||
--execDepth;
|
--execDepth;
|
||||||
|
|
||||||
|
for(const auto& item : history)
|
||||||
|
debugger.prompt().addToHistory(item.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -784,7 +784,6 @@ void PromptWidget::nextLine()
|
||||||
updateScrollBuffer();
|
updateScrollBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
// Call this (at least) when the current line changes or when a new line is added
|
// Call this (at least) when the current line changes or when a new line is added
|
||||||
void PromptWidget::updateScrollBuffer()
|
void PromptWidget::updateScrollBuffer()
|
||||||
|
|
|
@ -51,6 +51,8 @@ class PromptWidget : public Widget, public CommandSender
|
||||||
// Clear screen and erase all history
|
// Clear screen and erase all history
|
||||||
void clearScreen();
|
void clearScreen();
|
||||||
|
|
||||||
|
void addToHistory(const char *str);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int& buffer(int idx) { return _buffer[idx % kBufferSize]; }
|
int& buffer(int idx) { return _buffer[idx % kBufferSize]; }
|
||||||
|
|
||||||
|
@ -75,7 +77,6 @@ class PromptWidget : public Widget, public CommandSender
|
||||||
void textPaste();
|
void textPaste();
|
||||||
|
|
||||||
// History
|
// History
|
||||||
void addToHistory(const char *str);
|
|
||||||
void historyScroll(int direction);
|
void historyScroll(int direction);
|
||||||
|
|
||||||
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;
|
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;
|
||||||
|
|
Loading…
Reference in New Issue