denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] [bug #44228] Cursor not in view in LilyPond window after


From: Richard Shann
Subject: [Denemo-devel] [bug #44228] Cursor not in view in LilyPond window after refresh
Date: Wed, 11 Feb 2015 09:16:52 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.4.0

URL:
  <http://savannah.gnu.org/bugs/?44228>

                 Summary: Cursor not in view in LilyPond window after refresh
                 Project: Denemo
            Submitted by: rshann
            Submitted on: Wed 11 Feb 2015 09:16:51 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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...






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44228>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]