mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] Fix prompt after input
This commit is contained in:
@@ -81,13 +81,10 @@ void ConsoleController::runAndPrintForCommand(const char * command) {
|
||||
assert(m_outputAccumulationBuffer[0] == '\0');
|
||||
|
||||
// Draw the console before running the code
|
||||
m_selectableTableView.reloadData();
|
||||
m_selectableTableView.selectCellAtLocation(0, m_consoleStore.numberOfLines());
|
||||
m_editCell.setEditing(false);
|
||||
m_preventEdition = true;
|
||||
m_editCell.setText("");
|
||||
m_editCell.setPrompt("");
|
||||
m_preventEdition = true;
|
||||
AppsContainer::sharedAppsContainer()->redrawWindow();
|
||||
refreshPrintOutput();
|
||||
|
||||
runCode(storedCommand);
|
||||
|
||||
@@ -134,6 +131,7 @@ const char * ConsoleController::inputText(const char * prompt) {
|
||||
}
|
||||
}
|
||||
|
||||
const char * previousPrompt = m_editCell.promptText();
|
||||
m_editCell.setPrompt(promptText);
|
||||
m_editCell.setText("");
|
||||
|
||||
@@ -156,7 +154,9 @@ const char * ConsoleController::inputText(const char * prompt) {
|
||||
printText(text, strlen(text));
|
||||
flushOutputAccumulationBufferToStore();
|
||||
|
||||
m_editCell.setPrompt(sStandardPromptText);
|
||||
m_editCell.setPrompt(previousPrompt);
|
||||
m_editCell.setText("");
|
||||
refreshPrintOutput();
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
void setText(const char * text);
|
||||
bool insertText(const char * text);
|
||||
void setPrompt(const char * prompt);
|
||||
const char * promptText() const { return m_promptView.text(); }
|
||||
private:
|
||||
PointerTextView m_promptView;
|
||||
TextField m_textField;
|
||||
|
||||
Reference in New Issue
Block a user