如何在 Geany 中自定义缩进
How to customize indentation in Geany
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.
我正在为新 DSL 开发新编辑器。我没有任何类型的大括号,所以缩进必须基于字符串。如何将自动缩进应用于我的自定义语法。有什么简单快捷的方法吗?
Scintilla 可能就是您要找的东西。在 LexDSL.cxx 内实现折叠时使用的策略可以解决它。基于级别的代码折叠实现也可以确定选项卡的深度。每个级别都意味着新选项卡,使用该策略可以使在 geany 中自定义缩进成为可能。
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.
我正在为新 DSL 开发新编辑器。我没有任何类型的大括号,所以缩进必须基于字符串。如何将自动缩进应用于我的自定义语法。有什么简单快捷的方法吗?
Scintilla 可能就是您要找的东西。在 LexDSL.cxx 内实现折叠时使用的策略可以解决它。基于级别的代码折叠实现也可以确定选项卡的深度。每个级别都意味着新选项卡,使用该策略可以使在 geany 中自定义缩进成为可能。