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

elextr notifications at xxxxx
Sat Oct 16 01:54:48 UTC 2021


@elextr requested changes on this pull request.

Sorry about the dual reviews, I wanted to see if the first one would attach to the commit (it didn't) but then I couldn't add more to it.

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

This was deliberately added in https://github.com/geany/geany/commit/ff8664150bab4a9f59120c8d14ca7240ab21a5b6#diff-3fe5ce523684a7fca311fab0d09542552fbe3a28ddaa20ebc5a65c1904bc5e02 so it is desired by at least some people, and nobody (AFAICT) has wanted it changed since 2008.  So removing it just because one person doesn't like it doesn't seem reasonable.  

> @@ -2193,6 +2193,10 @@ Geany can automatically insert a closing bracket and quote characters when
 you open them. For instance, you type a ``(`` and Geany will automatically
 insert ``)``. With the following options, you can define for which
 characters this should work.
+For a more flowing writing (not move the typing hand to arrow keys) Geany
+checks if the character written is the closing quote or bracket that was
+previously inserted. In that case only one quote or bracket of the one written
+and the one previously inserted remains.

I disagree, it should be less concise and actually explain what happens, so its known that the behaviour is deliberate, especially as pretty much whatever autoclose behaviour is chosen there are edge cases that are annoying.  It really needs to document it properly.  The commit message is more explicit than the manual.

-- 
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#pullrequestreview-781317499
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211015/9febb6cd/attachment.htm>


More information about the Github-comments mailing list