indentationlexergeany

How to customize indentation in Geany


Based on geany documentation

Geany knows four types of auto-indentation:

None: Disables auto-indentation completely.

Basic: Adds the same amount of whitespace on a new line as on the last line.

Current chars: Does the same as Basic but also indents a new line after an opening brace '{', and de-indents when typing a closing brace '}'. For Python, a new line will be indented after typing ':' at the end of the previous line.

Match braces: Similar to Current chars but the closing brace will be aligned to match the indentation of the line with the opening brace.

I am developing new editor for new DSL. I don't have any kind of braces, so indentation must be based on strings. How can I apply auto-indentation to my custom syntax. Is there any short and easy way?


Solution

  • Scintilla can be the thing that you are looking for. Strategy which used while implementing folding inside LexDSL.cxx can be a solution for it. Level based implementation of code folding can also determine the deepness of the tab. Each level means new tab and using that strategy could make customization of indentation in geany be possible.