diff options
-rw-r--r-- | buffer.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -302,6 +302,7 @@ i64 numberWidth(i64 number){ void Buffer::show(i64 atx,i64 aty,i64 width,i64 height){ static const Style gutterStyle={3,9,false,false}; + static const Style gutterContinuationStyle={1,9,false,true}; static const Style textStyle={9,9,false,false}; static const Style specialStyle={5,9,false,false}; @@ -322,13 +323,17 @@ void Buffer::show(i64 atx,i64 aty,i64 width,i64 height){ i64 curScreenX=-1,curScreenY=-1; // cerr<<"Buffer::show: screen.size()="<<screen.size()<<endl; for(y=0;y<(i64)screen.size();y++){ - moveto(atx,aty+y); - setstyle(&gutterStyle); - i64 nspaces=gutterWidth-1-numberWidth(screen[y].line+1); - for(i64 i=0;i<nspaces;i++){ - tputc(' '); + if(screen[y].fromx==0){ + setstyle(&gutterStyle); + moveto(atx+gutterWidth-1-numberWidth(screen[y].line+1),aty+y); + tprintf("%" PRIi64,screen[y].line+1); + } else if(y==0){ + setstyle(&gutterContinuationStyle); + moveto(atx+gutterWidth-2-numberWidth(screen[y].line+1),aty+y); + tprintf("^%" PRIi64,screen[y].line+1); } - tprintf("%" PRIi64 " ",screen[y].line+1); + + moveto(atx+gutterWidth,aty+y); i64 screenX=atx+gutterWidth; setstyle(&textStyle); |