]> git.neil.brown.name Git - edlib.git/commitdiff
text: fit bug with text deletion.
authorNeilBrown <neil@brown.name>
Wed, 25 Nov 2015 21:47:07 +0000 (08:47 +1100)
committerNeilBrown <neil@brown.name>
Wed, 25 Nov 2015 21:47:07 +0000 (08:47 +1100)
I wasn't quite leaving things is a good state.
I think this is better - as this ref no longer over-takes
a follow ref that won't be relocated.
But I really need to review this code.

Signed-off-by: NeilBrown <neil@brown.name>
doc-text.c

index 3b0f9aa6c240998af9bab162285000efeaebbeb5..f16f18dd5ab39bb3af0236c13bd4fd650c13ebc3 100644 (file)
@@ -609,7 +609,7 @@ static void text_del(struct text *t, struct doc_ref *pos, int len, bool *first_e
                        c->end = pos->o;
                        attr_trim(&c->attrs, c->end);
                        text_add_edit(t, c, first_edit, 0, -diff);
-                       if (c->lst.next != &t->text) {
+                       if (len && c->lst.next != &t->text) {
                                pos->c = list_next_entry(c, lst);
                                pos->o = pos->c->start;
                        } else