diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/narrative_window.c | 2 | ||||
-rw-r--r-- | src/sc_editor.c | 11 | ||||
-rw-r--r-- | src/sc_editor.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c index 913d8da..6bed315 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -324,6 +324,8 @@ static void add_slide_sig(GSimpleAction *action, GVariant *parameter, SCBlock *templ; NarrativeWindow *nw = vp; + sc_editor_ensure_cursor(nw->sceditor); + /* Split the current paragraph */ nsblock = split_paragraph_at_cursor(nw->sceditor); diff --git a/src/sc_editor.c b/src/sc_editor.c index 897bdad..e087b55 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -374,6 +374,17 @@ void sc_editor_set_background(SCEditor *e, double r, double g, double b) } +void sc_editor_ensure_cursor(SCEditor *e) +{ + if ( e->cursor_frame != NULL ) return; + e->cursor_frame = e->top; + e->cpos.para = 0; + e->cpos.pos = 0; + e->cpos.trail = 0; + e->selection = NULL; +} + + void sc_editor_remove_cursor(SCEditor *e) { e->cursor_frame = NULL; diff --git a/src/sc_editor.h b/src/sc_editor.h index 6584aef..5fea0e1 100644 --- a/src/sc_editor.h +++ b/src/sc_editor.h @@ -189,6 +189,7 @@ extern void sc_editor_add_storycode(SCEditor *e, const char *sc); extern void sc_editor_copy_selected_frame(SCEditor *e); extern void sc_editor_delete_selected_frame(SCEditor *e); extern void sc_editor_remove_cursor(SCEditor *e); +extern void sc_editor_ensure_cursor(SCEditor *e); extern SCBlock *split_paragraph_at_cursor(SCEditor *e); extern void sc_editor_set_imagestore(SCEditor *e, ImageStore *is); |