From b972e26307d0f87ffdc5b9a88d95ab3fe319d067 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 11 Jan 2017 22:32:47 +0100 Subject: Show basic prompt --- buffer.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'buffer.h') diff --git a/buffer.h b/buffer.h index 64d7aa4..119097e 100644 --- a/buffer.h +++ b/buffer.h @@ -13,9 +13,6 @@ using namespace std; class Manager; class Buffer{ - TextBlob tb; - Manager *manager; - struct Cell{ char c; bool special; @@ -26,18 +23,25 @@ class Buffer{ i64 fromx; //starting at what x into the line does this screen line have text vector cells; }; - vector screen; - i64 lastWidth=-1,lastHeight=-1; //excluding the gutter struct Cursorpos{ i64 line,x; }; - Cursorpos cursor={0,0}; struct Screenpos{ i64 y,x; }; + Manager *const manager; + const bool singleLineMode=false; + + TextBlob tb; + + vector screen; + i64 lastWidth=-1,lastHeight=-1; //excluding the gutter + + Cursorpos cursor={0,0}; + vector layoutLine(const string &line,i64 linenum,i64 width); void performInitialLayout(i64 width,i64 height); void renewLayout(i64 topLine,i64 topPart,i64 width,i64 height); @@ -52,7 +56,10 @@ public: string filename; Buffer(Manager *manager); + Buffer(Manager *manager,bool singleLineMode); void receive(const Command &cmd); void show(i64 atx,i64 aty,i64 width,i64 height); + + string getText() const; }; -- cgit v1.2.3-70-g09d2