aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-10-23 21:36:28 +0200
committerThomas White <taw@physics.org>2017-10-23 21:39:34 +0200
commit0415e3697398e74e4e5a3620190c103ad402b129 (patch)
treee0547ce37dec6ded11cfb90fc4eeba11eb0fea85 /src
parenteb1704edb0f616afa3631d78e0e4b2f093c93f22 (diff)
Ensure initialisation of cursor position
Diffstat (limited to 'src')
-rw-r--r--src/sc_editor.c8
1 files changed, 8 insertions, 0 deletions
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; i<e->cursor_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);