[Geany-Devel] Geany performance

Lex Trotman elextr at xxxxx
Sun Sep 29 09:37:50 UTC 2013


On 29 September 2013 18:47, Pavel Roschin <rpg89 at post.ru> wrote:

> > It is. If I understand correctly the original reason for this is because
> > when you set the scintilla buffer (at least as it goes currently), it
> > pushes the cursor to the end of the inserted text, and so it needs to be
> > pushed back to the start by default (if no other position is stored or
> > specified). Please excuse if I'm mistaken here.
>
> Geany with my patch behaves normally without unnecessary goto_pos. But
> today
> I added more clear-looking patch that skips goto-ing if pos == current_pos.
> Isn't? Try, it will take 2 minutes:
>
> void sci_goto_pos(ScintillaObject *sci, gint pos, gboolean unfold)
> {
>         if (unfold) SSM(sci, SCI_ENSUREVISIBLE, (uptr_t) SSM(sci,
>         SCI_LINEFROMPOSITION, (uptr_t) pos, 0), 0);
>         /* Do not goto if we are already here */
>         if(pos == sci_get_current_position(sci)) return;
>         SSM(sci, SCI_GOTOPOS, (uptr_t) pos, 0);
> }
>

The problem with this is that by not calling the SSM(sci, SCI_GOTOPOS,
(uptr_t) pos, 0); you don't schedule an updateUI and you then don't get the
associated notifications.  I don't know what impacts that might have,
especially as plugins can depend on those notifications.

I would be *very* wary changing the semantics of such low level functions
without great care, checking where they are used and all the side effects,
such as the notification callbacks.

Cheers
Lex


>
> --
> Best regards,
> Pavel Roschin aka RPG
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130929/48f0dd54/attachment.html>


More information about the Devel mailing list