|
|
|
@ -14,6 +14,10 @@ namespace groove { |
|
|
|
|
this->modes.emplace(Mode::EDIT, std::make_unique<modes::Edit>(*this)); |
|
|
|
|
this->modes.emplace(Mode::QUIT, std::make_unique<modes::Quit>(*this)); |
|
|
|
|
this->modes.emplace(Mode::SAVE, std::make_unique<modes::Save>(*this)); |
|
|
|
|
|
|
|
|
|
this->overlay = newwin(LINES * 0.9, COLS * 0.9, (LINES * 0.1f) / 2.0f, (COLS * 0.1f) / 2.0f); |
|
|
|
|
box(this->overlay, 0, 0); |
|
|
|
|
|
|
|
|
|
if (!this->load()) { |
|
|
|
|
std::cerr << "Could not open file: '" << this->filename << "', creating it on save.\n"; |
|
|
|
|
this->buffer->insert(""); |
|
|
|
@ -126,6 +130,8 @@ namespace groove { |
|
|
|
|
} |
|
|
|
|
this->status(); |
|
|
|
|
move(static_cast<int>(this->y - this->offset), static_cast<int>(this->x + this->vspace)); |
|
|
|
|
this->renderOverlay(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Editor::status() { |
|
|
|
|