aboutsummaryrefslogtreecommitdiffstats
path: root/editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor.cpp')
-rw-r--r--editor.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/editor.cpp b/editor.cpp
index b7ed487..9c35249 100644
--- a/editor.cpp
+++ b/editor.cpp
@@ -1,9 +1,26 @@
#include "editor.h"
+#include "utils.h"
+
+Editor::Editor(std::vector<std::string>* contents):
+ m_current_line(0) {
-Editor::Editor(std::string* contents) {
m_contents = contents;
}
int Editor::run_editor() {
+ std::vector<std::string>* c = m_contents;
+
+ bool stopped = false;
+ while (!stopped) {
+ print_contents_on_line(m_current_line);
+
+ char input = Utils::getch();
+ }
return 0;
}
+
+int Editor::print_contents_on_line(int line) const {
+ for (int i = line; i < m_contents->size(); i++) {
+ std::cout << i << " " << m_contents->at(i) << '\n';
+ }
+}