tlbuf: increase the number of lines after moving the old ones - neatvi - [fork] simple vi-type editor with UTF-8 support
HTML git clone git://src.adamsgaard.dk/neatvi
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR commit d7772d9c05727a0892b134ed83bd2f834a039fa6
DIR parent 1aaf74068c7eee5e00a1743ee660fcb4576ddb30
HTML Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Fri, 15 May 2015 08:38:22 +0430
lbuf: increase the number of lines after moving the old ones
Diffstat:
M lbuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/lbuf.c b/lbuf.c
t@@ -57,9 +57,9 @@ static void lbuf_insertline(struct lbuf *lb, int pos, char *s)
lb->ln = nln;
lb->ln_sz = nsz;
}
- lb->ln_n++;
memmove(lb->ln + pos + 1, lb->ln + pos,
(lb->ln_n - pos) * sizeof(lb->ln[0]));
+ lb->ln_n++;
lb->ln[pos] = s;
}