aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2017-05-20 21:28:58 +0200
committerThomas White <taw@bitwiz.org.uk>2017-05-20 21:28:58 +0200
commitc6c1a2e6b3f4bca8e833d3c519a78bcf2f41d5c3 (patch)
tree125e2122c3a98872c1ca7303c16a2d2ff5f197e4
parent3413239509a9a00d89199f8aa661504f43dcf585 (diff)
Set cursor position after block delete
-rw-r--r--src/sc_editor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index ffc895f..32974fb 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -723,6 +723,12 @@ static void do_backspace(struct frame *fr, SCEditor *e)
printf("delete block\n");
delete_text_from_frame(e->cursor_frame, e->sel_start, e->sel_end, wrapw);
+ /* Cursor goes at start of deletion */
+ e->cursor_para = e->sel_start.para;
+ e->cursor_pos = e->sel_start.pos;
+ e->cursor_trail = e->sel_start.trail;
+ e->sel_active = 0;
+
} else {
/* Delete one character */