[Geany-Users] Auto-close quotes and brackets

Lex Trotman elextr at xxxxx
Sat Sep 15 00:13:18 UTC 2018

On Sat, 15 Sep 2018 at 09:33, John Yeung <gallium.arsenide at gmail.com> wrote:
> On Fri, Sep 14, 2018 at 7:06 PM Lex Trotman <elextr at gmail.com> wrote:
> > Auto close is not to save typing.
> I absolutely agree with the above. However,
> > The point of auto close parens and other brackety things is so the
> > code remains likely to be reasonably valid whilst typing, so symbol
> > parsers will still work.
> I think this varies a lot depending on the editor. Some editors seem
> to be affected much worse than others, and even in the same editor,
> some languages could be affected much worse than others.

Of course, some syntaxes are easier to parse even with errors, some
are not.  Any parser can parse correct code, being tolerant of errors
is "more difficult".  IIUC Microsoft has spent "rather a lot" on the
parsers used in full VS.

> One thing I noticed about Atom and Visual Studio Code, for example, is
> that when brackets are not closed, *some* of the highlighting still
> works but some doesn't. Also, neither one can actively detect that an
> open bracket is unmatched.
> However, SciTE (which uses Scintilla, the same core as Geany and
> Notepad++) DOES detect unmatched open brackets.

Scite only does syntactic highlighting, it doesn't parse declarations
in the code.  And Geany does detect unmatched brackets, although the
default theme doesn't make them terribly visible (just bold).  You can
of course change the theme.  And if you are editing inside say C code,
a new open { will always match, its the one before it that does not
appear to match to the Scintilla naive algorithm  :)

Geany uses the ctags parsers to parse declarations to populate the
symbols tab and to feed Scintilla the type lists to be highlighted,
which Scite does not do.  Parsing is more dependent on legal syntax,
its noticeable that following symbols will often disappear from the
symbols tab when unmatched brackets occur.

> Even if you buy into the idea that closed brackets are to help the
> editor work better, the increased inconvenience in typing is a fairly
> high price to pay. Editors are supposed to work for *us*, not the
> other way around.

And thats why the feature can be turned off at the users discretion.


> John Y.
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users

More information about the Users mailing list