Block Indent Converts Spaces to Tabs

SyntaxEditor for WPF Forum

Posted 9 years ago by Peter MacNeil
Version: 13.2.0591
Avatar

Hello,

We've implemented a fairly simple Editor with your WPF SyntaxEditor control. We load an xml language into each new document so we have colorization but we currently aren't implementing any additional features such as our own lexers or parsers.

When pressing enter on a line with four leading spaces the new line's indent is converted to a tab. We would like the new line to be indented as the previous line was indented with spaces. (We would also like the new line to indent with a tab if the previous line had a tab but it already does that and we don't want to break it.)

I've reviewed the Auto Indent feature (defaults to Block)  and the document's AutoConvertTabsToSpaces property in the provided documentation and here in the forums. The supplied docs state AutoConvertTabsToSpaces defaults to false but the discussions I found here in the forum state it defaults to true.

I set my document's AutoConvertTabsToSpaces property to false.

 

I appreciate any advice you can provide.

 

Thank you!

Comments (2)

Answer - Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Peter,

The AutoConvertTabsToSpaces property is what governs the kind of whitespace that gets inserted.  If it is false, that means that it will insert tabs.  If it is true, it will insert spaces in place of tabs.  It defaults to false, meaning insert tab characters instead of spaces.

There isn't anything in our codebase that will examine the previous line to see what kind of whitespace it used and then use similar whitespace though.  Our indentation and whitespace insertion is always based on the AutoConvertTabsToSpaces setting you have active.


Actipro Software Support

Posted 9 years ago by Peter MacNeil
Avatar

That's just what I needed to know.

Thank you for the help.

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.