From 779a3436b14d3152e376949fb1294cb62e46a4d7 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 14 Oct 2015 23:24:53 +0200 Subject: Use update_local() for backspace as well --- src/sc_editor.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sc_editor.c b/src/sc_editor.c index 6619b06..8a6bae5 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -684,9 +684,20 @@ static void do_backspace(struct frame *fr, SCEditor *e) // scbl = sc_block_next(scbl); // } while ( (scbl != fbox->scblock) && (scbl != NULL) ); - full_rerender(e); /* FIXME: No need for full */ - //fixup_cursor(e); - //sc_editor_redraw(e); + /* Update the length of the box in the unwrapped and un-paragraph-split + * string of wrap boxes */ + sbox->cf->cf->len_chars -= 1; + + /* ... and also in the paragraph split but unwrapped box */ + sbox->cf->len_chars -= 1; + + /* Tweak the offsets of all the subsequent boxes */ + shift_box_offsets(fr, sbox->cf->cf, -1); + + update_local(e, fr, sln, sbx); + + fixup_cursor(e); + sc_editor_redraw(e); } -- cgit v1.2.3