@@ -59,6 +59,37 @@ import Highlightr
5959 * Note: The `CodeEditor` doesn't do automatic theme changes if the appearance
6060 * changes.
6161 *
62+ * ### Smart Indent and Open/Close Pairing
63+ *
64+ * Inspired by [NTYSmartTextView](https://github.com/naoty/NTYSmartTextView),
65+ * `CodeEditor` now also supports (on macOS):
66+ * - smarter indents (preserving the indent of the previous line)
67+ * - soft indents (insert a configurable amount of spaces if the user presses tabs)
68+ * - auto character pairing, e.g. when entering `{`, the matching `}` will be auto-added
69+ *
70+ * To enable smart indents, add the `smartIndent` flag, e.g.:
71+ *
72+ * CodeEditor(source: $source, language: language,
73+ * flags: [ .selectable, .editable, .smartIndent ])
74+ *
75+ * It is enabled for editors by default.
76+ *
77+ * To configure soft indents, use the `indentStyle` parameter, e.g.
78+ *
79+ * CodeEditor(source: $source, language: language,
80+ * indentStyle: .softTab(width: 2))
81+ *
82+ * It defaults to tabs, as per system settings.
83+ *
84+ * Auto character pairing is automatic based on the language. E.g. there is a set of
85+ * defaults for C like languages (e.g. Swift), Python or XML. The defaults can be overridden
86+ * using the respective static variable in `CodeEditor`,
87+ * or the desired pairing can be set explicitly:
88+ *
89+ * CodeEditor(source: $source, language: language,
90+ * autoPairs: [ "{": "}", "<": ">", "'": "'" ])
91+ *
92+ *
6293 * ### Font Sizing
6394 *
6495 * On macOS the editor supports sizing of the font (using Cmd +/Cmd - and the
0 commit comments