|
|
@ -9,7 +9,7 @@ namespace groove { |
|
|
|
Editor::Editor(std::string filename) : x(0), y(0), |
|
|
|
Editor::Editor(std::string filename) : x(0), y(0), |
|
|
|
buffer(std::make_unique<Buffer>()), mode_(Mode::EDIT), |
|
|
|
buffer(std::make_unique<Buffer>()), mode_(Mode::EDIT), |
|
|
|
filename(filename), offset(0), voffset(0), |
|
|
|
filename(filename), offset(0), voffset(0), |
|
|
|
history(History()), inComment(false), config(config::ConfigParser()) { |
|
|
|
history(History()), inComment(false) { |
|
|
|
this->modes.emplace(Mode::INSERT, std::make_unique<modes::Insert>(*this)); |
|
|
|
this->modes.emplace(Mode::INSERT, std::make_unique<modes::Insert>(*this)); |
|
|
|
this->modes.emplace(Mode::EDIT, std::make_unique<modes::Edit>(*this)); |
|
|
|
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::QUIT, std::make_unique<modes::Quit>(*this)); |
|
|
@ -17,7 +17,7 @@ namespace groove { |
|
|
|
this->modes.emplace(Mode::EXIT, std::make_unique<modes::Exit>(*this)); |
|
|
|
this->modes.emplace(Mode::EXIT, std::make_unique<modes::Exit>(*this)); |
|
|
|
|
|
|
|
|
|
|
|
this->lineMode = this->config.get<std::string>("linenumbers") == "relative" ? LineMode::RELATIVE : |
|
|
|
this->lineMode = this->config.get<std::string>("linenumbers") == "relative" ? LineMode::RELATIVE : |
|
|
|
this->config.get<std::string>("linenumbers") == "none" ? LineMode::NONE : LineMode::NUMBERS; |
|
|
|
(this->config.get<std::string>("linenumbers") == "none" ? LineMode::NONE : LineMode::NUMBERS); |
|
|
|
|
|
|
|
|
|
|
|
this->overlay = newwin(LINES * 0.9, COLS * 0.9, (LINES * 0.1f) / 2.0f, (COLS * 0.1f) / 2.0f); |
|
|
|
this->overlay = newwin(LINES * 0.9, COLS * 0.9, (LINES * 0.1f) / 2.0f, (COLS * 0.1f) / 2.0f); |
|
|
|
box(this->overlay, 0, 0); |
|
|
|
box(this->overlay, 0, 0); |
|
|
|