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

 
 

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

Submitted by:  Richard Shann <rshann>
Submitted on:  Wed 11 Feb 2015 09:16:51 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

in 1.2.3

Richard Shann <rshann>
Project 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>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 11 Feb 2015 05:14:14 PM UTCrshannStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1