aboutsummaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2018-03-28 14:51:54 +0200
committerThomas White <taw@bitwiz.me.uk>2018-03-28 14:51:54 +0200
commit6cb58d80203fab0f58e8e0863d6c17f9fbaf6ea3 (patch)
tree885751258cb330b25abca7a8c5a412d7a41c1e45 /src/frame.c
parent80717944576ff3fec50b037480c9dd8295b1b1b3 (diff)
Rearrange editability checks when inserting text
Makes "insert into non-text paragraph" work again
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c
index b87a7c3..ab9e0af 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1024,6 +1024,11 @@ int position_editable(struct frame *fr, struct edit_pos cp)
return 0;
}
+ if ( para->type != PARA_TYPE_TEXT ) {
+ fprintf(stderr, "Paragraph is not text.\n");
+ return 0;
+ }
+
paraoffs = pos_trail_to_offset(para, cp.pos, cp.trail);
run = which_run(para, paraoffs);
if ( run == para->n_runs ) {