diff options
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index 37bba88..748089e 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -603,22 +603,24 @@ static void do_backspace(struct frame *fr, SCEditor *e) size_t new_pos = old_pos; int new_trail = old_trail; + double wrapw = e->cursor_frame->w - e->cursor_frame->pad_l + - e->cursor_frame->pad_r; + Paragraph *para = e->cursor_frame->paras[old_para]; cursor_moveh(e->cursor_frame, &new_para, &new_pos, &new_trail, -1); cursor_moveh(e->cursor_frame, &e->cursor_para, &e->cursor_pos, &e->cursor_trail, -1); if ( e->cursor_para != old_para ) { - /* FIXME: Implement this case */ - printf("Merge paragraphs!\n"); - return; - } + merge_paragraphs(e->cursor_frame, e->cursor_para); + wrap_paragraph(e->cursor_frame->paras[new_para], NULL, wrapw); + } else { - delete_text_in_paragraph(para, e->cursor_pos+e->cursor_trail, - old_pos+old_trail); + delete_text_in_paragraph(para, e->cursor_pos+e->cursor_trail, + old_pos+old_trail); + wrap_paragraph(para, NULL, wrapw); + } - wrap_paragraph(para, NULL, e->cursor_frame->w - e->cursor_frame->pad_l - - e->cursor_frame->pad_r); sc_editor_redraw(e); } |