bobbylight / RSyntaxTextArea

A syntax highlighting, code folding text editor for Java Swing applications.
BSD 3-Clause "New" or "Revised" License
1.12k stars 259 forks source link

selectively alter curly brace auto-unindent behavior #452

Open gyorokpeter opened 2 years ago

gyorokpeter commented 2 years ago

In the programming language q there is a unique rule regarding curly braces. Normally they stack like in C. However the closing curly brace of a function must not be unindented all the way to the left, there must be at least one space before it, otherwise it leads to a syntax error. It seems that currently auto-unindent is "all or nothing" - getCurlyBracesDenoteCodeBlocks can be used to either enable it or disable it, but if it's enabled, I have to manually compensate for the excessive unindenting which kills the value of this "convenience" feature. So there should be a way to alter the behavior such that it doesn't unindent to the start of the line. See https://github.com/finos/kdb-studio/pull/111