[Github-comments] [geany/geany] Enable local variables for C/C++ and improve autocompletion (PR #3185)

Jiří Techet notifications at github.com
Sat Apr 30 22:06:38 UTC 2022


@techee commented on this pull request.



> @@ -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);

I didn't explore the logic of how we show the popup and if we need it (but @elextr seemed to experience some problem without it). The way I understand it is that when we call `SCI_AUTOCSHOW`, 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 `2*log(N)` (plus the initial creation of the index) instead of `N` if it had to go through all the values every time.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3185#discussion_r862400295
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/3185/review/958523358 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220430/254cb75e/attachment-0001.htm>


More information about the Github-comments mailing list