[Github-comments] [geany/geany] A problem with "go to matching brace" command. (#1998)

elextr notifications at xxxxx
Fri Mar 29 02:03:24 UTC 2019


To make it clear, I am not saying do not improve the goto brace feature, it is acknowledged that there are circumstances where it behaves less than optimally. 

You give specific examples where it fails, thats fine, its acknowledged it is imperfect, but until you show that those examples exceed the entire Linux Kernal source plus GNU source plus the rest of the C code base and much of the Java code base and much of the Javascript code base and [other brace equipped languages] then those cases are unlikely to be the majority of Geany users.  

This is not to downplay the pain you feel if it is less useful in code you commonly edit, just to say it would  appear that it is useful in many more cases than where it is problematic.

Therefore I am saying when improving goto brace, do not break existing useful functionality, by which I mean when goto brace is used twice on code braces in many common cases it returns the cursor to the original position.  This may mean you need a more complex algorithm than that you proposed thats all, for example it may need to remember its original position.

This useful behaviour was kept even when "braces" was extended to "all brackets" even though it causes issues with those.

> Geany, use blue color, which is not very contrasted. 

Its configured in the colour scheme, so you can look at other [colour schemes](https://github.com/geany/geany-themes), or make your own, or just configure the default it in your personal configuration (Menu->Tools->Configuration files->filetypes.common [named_styles] brace_good).

>  I would suggest removing the sentence "If this keyboard shortcut is pressed again, the cursor is moved back to the first brace." or indicating when it will do it, and when will not. Users should not be misinformed. Right? :)

Since your next algorithm will make this true in even more cases, it doesn't need to be removed :grin:

In the meantime, a pull request to say "If this keyboard shortcut is pressed again, in most cases the cursor is moved back to the first brace." would be accepted.  And probably a note that it works on other bracket types but less perfectly could be added, since they are actually not even mentioned at all.  It would appear that "brace" was extended to "all brackets" without updating the manual :frowning_face: .

-- 
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/issues/1998#issuecomment-477837068
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190328/85419b43/attachment.html>


More information about the Github-comments mailing list