bugDenemo - Bugs: bug #44228, Cursor not in view in LilyPond...

 
 

bug #44228: Cursor not in view in LilyPond window after refresh

Submitter:  Richard Shann <rshann>
Submitted:  Wed 11 Feb 2015 09:16:51 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 11 Feb 2015 05:14:14 PM UTC, comment #1: 

in 1.2.3

Richard Shann <rshann>
Group administrator
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...


Richard Shann <rshann>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rshann (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-11 rshann StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code