aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sc_editor.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c
index f205777..35a96c0 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -426,8 +426,21 @@ void cur_box_diag(SCEditor *e)
return;
}
+ if ( fr->lines[sln].boxes == NULL ) {
+ printf("line %i of %i, but it has no boxes\n",
+ sln, fr->n_lines);
+ return;
+ }
+
struct wrap_box *sbox = bv_box(fr->lines[sln].boxes, sbx);
+ if ( sbox == NULL ) {
+ printf("line/box: [%i of %i]/[%i of %i]/NULL box\n",
+ sln, fr->n_lines, sbx,
+ bv_len(e->cursor_frame->lines[sln].boxes));
+ return;
+ }
+
printf("line/box/pos: [%i of %i]/[%i of %i]/[%i of %i]\n",
sln, fr->n_lines, sbx, bv_len(e->cursor_frame->lines[sln].boxes),
sps, sbox->len_chars);