forked from enlightenment/terminology
sb: when skipping buffer on the left and the buffer is empty, remove gap
This commit is contained in:
parent
6bfd508a58
commit
e1f3a4d486
13
src/bin/sb.c
13
src/bin/sb.c
|
@ -108,8 +108,17 @@ void
|
|||
ty_sb_lskip(struct ty_sb *sb, int len)
|
||||
{
|
||||
sb->len -= len;
|
||||
sb->gap += len;
|
||||
sb->buf += len;
|
||||
if (sb->len)
|
||||
{
|
||||
sb->gap += len;
|
||||
sb->buf += len;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* buffer is empty, get rid of gap */
|
||||
sb->buf -= sb->gap;
|
||||
sb->gap = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue