Posted 18 years ago
by Sergey Astachov
Version: 4.0.0253
Platform: .NET 2.0
Environment: Windows XP (32-bit)

I tried to use your xml text formatter and it seems that FormatDocument method work perfectly BUT FormatSelection make very strange things.
For example I have following xml (please note that there is 4 leading spaces before the <node1> and other tags, it is important):When I select text like the following:
and try to use syntaxEditor.Document.Language.FormatSelection(syntaxEditor) all work ok.
But when i try to select several lines using "shift+down" like this:In this case SyntaxEditor inserts 1 or 2 or more unnecessary lines above the selection and unnecessary "\t" before the <node3> tag.
For example I have following xml (please note that there is 4 leading spaces before the <node1> and other tags, it is important):
<node1>
<node2></node2>
</node1>
<node3>
</node3>
{start selection}<node1>
<node2></node2>
</node1>{end selection}
<node3>
</node3>
But when i try to select several lines using "shift+down" like this:
{start selection} <node1>
<node2></node2>
</node1>
{end selection} <node3>
</node3>