diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-10-14 23:24:53 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-10-14 23:24:53 +0200 |
commit | 779a3436b14d3152e376949fb1294cb62e46a4d7 (patch) | |
tree | 46eb0708eb664c6e36033d0272cde82e5358b7d4 | |
parent | e6e84a27ee6eb6c52fc26aa4f175e85af07fd901 (diff) |
Use update_local() for backspace as well
-rw-r--r-- | src/sc_editor.c | 17 |
1 files changed, 14 insertions, 3 deletions
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); } |