Wed 11 Feb 2015 09:16:51 AM UTC, original submission:
The cursor position in the LilyPond window is unaltered when the text is typeset but the view often changes to show the mid-point (?) or start of the LilyPond syntax.
This may be connected with the appending of three anchors with newlines at the end of the text.
The anchors can be made visible thus:
//g_object_set (G_OBJECT (t), "invisible", TRUE, NULL);
at line 3169 in src/export/exportlilypond.c
If the scoreblock is a custom scoreblock every refresh adds a further three newlines, these can be avoided with g_strchomp() when adding the scoreblock at line 2500
insert_editable (&sb->lilypond, g_strchomp((sb->lilypond)->str), &iter, gui, 0, 0, 0, 0, 0, 0, 0, 0);
The adjustment of the view should be done thus:
in export_lilypond () at line 2700
GtkTextIter startiter, enditer, iter;
gint offset;
offset = get_cursor_offset ();
to get the current offset and then, after the typesetting
gtk_text_buffer_get_iter_at_offset (Denemo.textbuffer, &iter, offset);
gtk_text_buffer_place_cursor (Denemo.textbuffer, &iter);
gtk_text_view_scroll_to_mark (GTK_TEXT_VIEW (Denemo.textview),
gtk_text_buffer_get_insert (Denemo.textbuffer),
0.0,
//TRUE, 0.5, 0.5);
FALSE, 0.5, 0.5);
//gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (Denemo.textview), gtk_text_buffer_get_insert (Denemo.textbuffer));
the last two lines are alternatives.
However, something is (re?) setting the view elsewhere...
|