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.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'buffer.cpp') diff --git a/buffer.cpp b/buffer.cpp index 05bbffa..645d63c 100644 --- a/buffer.cpp +++ b/buffer.cpp @@ -16,6 +16,9 @@ using namespace std; Buffer::Buffer(Manager *manager) :manager(manager){} +Buffer::Buffer(Manager *manager,bool singleLineMode) + :manager(manager),singleLineMode(singleLineMode){} + void Buffer::handleCommand(const Command &cmd){ //TODO: optimise the relayoutScreen's in this function @@ -391,7 +394,7 @@ void Buffer::show(i64 atx,i64 aty,i64 width,i64 height){ static const Style textStyle={9,9,false,false}; static const Style specialStyle={5,9,false,false}; - i64 gutterWidth=numberWidth(tb.numLines())+2; + i64 gutterWidth=singleLineMode ? 0 : numberWidth(tb.numLines())+2; i64 newWidth=width-gutterWidth; if(newWidth!=lastWidth||height!=lastHeight||screen.size()==0){ if(lastWidth==-1)performInitialLayout(newWidth,height); @@ -408,14 +411,16 @@ void Buffer::show(i64 atx,i64 aty,i64 width,i64 height){ i64 curScreenX=-1,curScreenY=-1; // cerr<<"Buffer::show: screen.size()="<