<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 29 September 2013 18:47, Pavel Roschin <span dir="ltr"><<a href="mailto:rpg89@post.ru" target="_blank">rpg89@post.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">> It is. If I understand correctly the original reason for this is because<br>

> when you set the scintilla buffer (at least as it goes currently), it<br>
> pushes the cursor to the end of the inserted text, and so it needs to be<br>
> pushed back to the start by default (if no other position is stored or<br>
> specified). Please excuse if I'm mistaken here.<br>
<br>
</div>Geany with my patch behaves normally without unnecessary goto_pos. But today<br>
I added more clear-looking patch that skips goto-ing if pos == current_pos.<br>
Isn't? Try, it will take 2 minutes:<br>
<br>
void sci_goto_pos(ScintillaObject *sci, gint pos, gboolean unfold)<br>
{<br>
        if (unfold) SSM(sci, SCI_ENSUREVISIBLE, (uptr_t) SSM(sci,<br>
        SCI_LINEFROMPOSITION, (uptr_t) pos, 0), 0);<br>
        /* Do not goto if we are already here */<br>
        if(pos == sci_get_current_position(sci)) return;<br>
        SSM(sci, SCI_GOTOPOS, (uptr_t) pos, 0);<br>
<div class="im">}<br></div></blockquote><div><br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div>
<div>Cheers</div><div>Lex</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">

<br>
--<br>
Best regards,<br>
Pavel Roschin aka RPG<br>
</div><div class=""><div class="h5">_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div>