<p></p>
<p><b>@techee</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/geany/geany/pull/3185#discussion_r862400295">src/editor.c</a>:</p>
<pre style='color:#555'>> @@ -601,6 +601,7 @@ static void show_autocomplete(ScintillaObject *sci, gsize rootlen, GString *word
        }
        /* store whether a calltip is showing, so we can reshow it after autocompletion */
        calltip.set = (gboolean) SSM(sci, SCI_CALLTIPACTIVE, 0, 0);
+       SSM(sci, SCI_AUTOCSETORDER, SC_ORDER_CUSTOM, 0);
</pre>
<p dir="auto">I didn't explore the logic of how we show the popup and if we need it (but <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/elextr/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/elextr">@elextr</a> seemed to experience some problem without it). The way I understand it is that when we call <code class="notranslate">SCI_AUTOCSHOW</code>, Scintilla takes care of filtering the list based on what the user types unless we update it ourselves. When the list is sorted, Scintilla can bisect where the start/end of the range to be displayed is and show the values in between (this really is my assumption, I haven't checked Scintilla sources). When not sorted, it first creates an index that corresponds to alphabetic ordering and does the bisection over this index. This makes the complexity <code class="notranslate">2*log(N)</code> (plus the initial creation of the index) instead of <code class="notranslate">N</code> if it had to go through all the values every time.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3185#discussion_r862400295">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ677S6V4UJHSN6NPPTVHWVG5ANCNFSM5UWGU33A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJ7WHKJTNWDMEK6HJ4LVHWVG5A5CNFSM5UWGU33KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOHEQ6PXQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany/pull/3185/review/958523358</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3185#discussion_r862400295",
"url": "https://github.com/geany/geany/pull/3185#discussion_r862400295",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>