diff options
| author | Jan Tuomi <jan-sebastian.tuomi@aalto.fi> | 2016-10-09 12:56:59 +0300 |
|---|---|---|
| committer | Jan Tuomi <jan-sebastian.tuomi@aalto.fi> | 2016-10-09 14:50:24 +0300 |
| commit | 7c9146efca9b565777e1093e65272f710ae5d0d9 (patch) | |
| tree | 7077241a78ee1f8d9a7044b08eb4714ad47f4020 /editor.cpp | |
| parent | 88996781bd89825501ae18a1ce6e7744e767db86 (diff) | |
Add editor content outputting
Diffstat (limited to 'editor.cpp')
| -rw-r--r-- | editor.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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'; + } +} |
