How to implement smart indenting

<< Click to display table of contents >>

How to implement smart indenting

You can find the examples in the support forum: https://www.trichview.com/forums/viewtopic.php?t=2044

There are two examples available.

Indenting in programming style

When the user presses  Enter , the code adds space characters at the beginning of the new paragraph (as many spaces as at the beginning of the current paragraph).

Indenting in Microsoft Word style

The code changes FirstIndent and LeftIndent of paragraph, if  Tab / Backspace  is pressed when the caret is at the beginning of paragraph. First, it changes FirstIndent. Next, if FirstIndent is already changed, it changes LeftIndent. The code changes indents only if the caret is at the beginning of non-empty paragraph.