aboutsummaryrefslogtreecommitdiff
path: root/src/sc_editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r--src/sc_editor.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index aabb84a..db0f11d 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -720,7 +720,6 @@ static void do_backspace(struct frame *fr, SCEditor *e)
if ( e->sel_active ) {
/* Delete the selected block */
- printf("delete block\n");
delete_text_from_frame(e->cursor_frame, e->sel_start, e->sel_end, wrapw);
/* Cursor goes at start of deletion */
@@ -753,15 +752,22 @@ static void do_backspace(struct frame *fr, SCEditor *e)
} else {
+ size_t del;
size_t offs_new, offs_old;
+ struct edit_pos pos;
offs_new = pos_trail_to_offset(para, e->cursor_pos,
e->cursor_trail);
offs_old = pos_trail_to_offset(para, old_pos, old_trail);
- delete_text_in_paragraph(para, offs_new, offs_old);
+ del = delete_text_in_paragraph(para, offs_new, offs_old);
+ pos.para = new_para;
+ pos.pos = new_pos;
+ pos.trail = new_trail;
+ fix_scblock_offsets(fr, pos, 1);
wrap_paragraph(para, NULL, wrapw, 0, 0);
+
}
}