diff options
Diffstat (limited to 'buffer.h')
-rw-r--r-- | buffer.h | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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<Cell> cells; }; - vector<ScreenLine> 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<ScreenLine> screen; + i64 lastWidth=-1,lastHeight=-1; //excluding the gutter + + Cursorpos cursor={0,0}; + vector<ScreenLine> 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; }; |