[Github-comments] [geany/geany] Improve auto close (#2943)

elextr notifications at xxxxx
Sun Oct 17 13:00:37 UTC 2021


@elextr commented on this pull request.



>  
 static void auto_close_chars(ScintillaObject *sci, gint pos, gchar c)
 {
 	const gchar *closing_char = NULL;
-	gint end_pos = -1;
-
-	if (utils_isbrace(c, 0))
-		end_pos = sci_find_matching_brace(sci, pos - 1);

I investigated what Eclipse does, it autocompletes `{` only when return is typed after it so
```
if(blah){
```
becomes
```
if(blah){
    |
}
```
where | is cursor.

This works pretty well, for me anyway, but its significantly different to the current Geany autocomplete.  Maybe the second commit using return after `{` can be modified to do autocomplete instead of on `{` additional alternative to current behaviour.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2943#discussion_r730411905
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211017/26fd4887/attachment.htm>


More information about the Github-comments mailing list