diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-08-24 18:42:35 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-08-24 18:44:25 +0200 |
commit | 9ec77a6ba0427897f591e6c3c7431b115a2e7b22 (patch) | |
tree | 7ddb8bcad7c5f333d69a515c2c0de1f04b22281b /src/sc_editor.c | |
parent | 5826c1d685f513a1364a9e49ad61ccef752a7e0b (diff) |
Escape gets rid of cursor in narrative window
Diffstat (limited to 'src/sc_editor.c')
-rw-r--r-- | src/sc_editor.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sc_editor.c b/src/sc_editor.c index 2936cf3..1b1bb04 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -66,6 +66,15 @@ void sc_editor_set_background(SCEditor *e, double r, double g, double b) } +void sc_editor_remove_cursor(SCEditor *e) +{ + e->cursor_frame = NULL; + e->cursor_line = 0; + e->cursor_pos = 0; + e->selection = NULL; +} + + /* (Re-)run the entire rendering pipeline. * NB "full" means "full". All frame, line and box handles will become * invalid. The cursor position will be unset. */ @@ -1087,7 +1096,7 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event, switch ( event->keyval ) { case GDK_KEY_Escape : - e->selection = NULL; + sc_editor_remove_cursor(e); sc_editor_redraw(e); claim = 1; break; |