Document.Language.FormatSelection works incorrectly

SyntaxEditor Web Languages Add-on for Windows Forms Forum

Posted 17 years ago by Sergey Astachov
Version: 4.0.0253
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
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):

    <node1>
        <node2></node2>
    </node1>
    <node3>
    </node3>
When I select text like the following:

    {start selection}<node1>
        <node2></node2>
    </node1>{end selection}
    <node3>
    </node3>
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:

{start selection}    <node1>
        <node2></node2>
    </node1>
{end selection}    <node3>
    </node3>
In this case SyntaxEditor inserts 1 or 2 or more unnecessary lines above the selection and unnecessary "\t" before the <node3> tag.

Comments (1)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi, yes this is a known issue. Right now the FormatDocument method is all that has been implemented correctly. We have on the TODO list to make FormatSelection work in the future as well.


Actipro Software Support

The latest build of this product (v24.1.0) was released 25 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.