Smart indent for XML files not working

SyntaxEditor Web Languages Add-on for Windows Forms Forum

Posted 12 years ago by John Carpenter
Version: 4.0.0259
Avatar
I am using the XmlSyntaxLanguage() language definition file but the smart indent isn't working. IE if I type:

<root>
<child>

and press "Enter" after the > of child, I get a closing tag and the cursor is placed on the far left and not lining up as I would expect. In your example application it works fine and everything lines up perfectly.

I am using pretty much the default settings and all the properties look the same. The "IndentType" is set to Smart and I really can't find anything else about it.

Is there anything else I need to do?

Thanks very much!

John

Comments (4)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It should be working per your settings. Could you put together a simple project that shows this happening and email it over so we can debug it? Thanks!


Actipro Software Support

Posted 12 years ago by John Carpenter
Avatar
Thanks very much for the quick reply. I've just knocked together something quickly to show the problem. Hopefully it's just me being an idiot and overlooking the obvious.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi John,

Thanks for the sample. It looks like our code requires an XmlSchemaResolver to be set for this to work properly, even if you don't load a schema. Because that has some code that helps figure out hierarchies, etc.

So in your sample add this line and it should work ok:
this.syntaxEditor1.Document.LanguageData = new XmlSchemaResolver();


Actipro Software Support

Posted 12 years ago by John Carpenter
Avatar
Ahh that's done it! Brilliant, thanks very much!

Very impressed with your quick and helpful service, thank you!
The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.