From 0415e3697398e74e4e5a3620190c103ad402b129 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 23 Oct 2017 21:36:28 +0200 Subject: Ensure initialisation of cursor position --- src/sc_editor.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sc_editor.c') diff --git a/src/sc_editor.c b/src/sc_editor.c index 5845326..dce5bb4 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -368,6 +368,7 @@ void sc_editor_remove_cursor(SCEditor *e) e->cursor_frame = NULL; e->cursor_para = 0; e->cursor_pos = 0; + e->cursor_trail = 0; e->selection = NULL; } @@ -1930,6 +1931,7 @@ void sc_editor_set_cursor_para(SCEditor *e, signed int pos) e->cursor_para = pos; } e->cursor_pos = 0; + e->cursor_trail = 0; h = 0; for ( i=0; icursor_para; i++ ) { @@ -1973,7 +1975,13 @@ SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock **stylesheets, sceditor->scroll_pos = 0; sceditor->flow = 0; sceditor->lang = lang; + sceditor->para_highlight = 0; + sceditor->cursor_frame = NULL; + sceditor->cursor_para = 0; + sceditor->cursor_pos = 0; + sceditor->cursor_trail = 0; + sceditor->selection = NULL; sceditor->stylesheets = copy_ss_list(stylesheets); -- cgit v1.2.3