From 7c9146efca9b565777e1093e65272f710ae5d0d9 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 9 Oct 2016 12:56:59 +0300 Subject: Add editor content outputting --- editor.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'editor.cpp') 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* contents): + m_current_line(0) { -Editor::Editor(std::string* contents) { m_contents = contents; } int Editor::run_editor() { + std::vector* 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'; + } +} -- cgit v1.3