XmlSyntaxLanguage::OnSyntaxEditorSmartIndent: Too far right

SyntaxEditor Web Languages Add-on for Windows Forms Forum

Posted 12 years ago by gardea
Version: 4.0.0256
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
I had to change the code since after enter is hit in between start tag/end tag, the cursor and the end tag are positioned "one tab" extra to the right.

This manifests even in the provided samples. Just load the XML Schema and then type a start tag element, >, and an enter.

To make it work I've changed it as bellow:

for (int index = 0; index < (e.IndentAmount / syntaxEditor.Document.TabSize) - 1; index++)
indentText += indentationString;
syntaxEditor.SelectedView.InsertSurroundingText(String.Empty, indentText);
//e.IndentAmount += syntaxEditor.Document.TabSize;
}
}

Basically, the for had its upper bound shortened by 1 and surrounding text was set to empty.

Thank you.

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Actually I believe it is working as designed. We made it work like Visual Studio where if you type a start tag, type '>' and then press Enter, it will insert the end tag two lines down, and will move the caret to the next line with one tabstop indentation. VS does this because when you insert a block tag, the contents should be indented and we do the same.


Actipro Software Support

Posted 12 years ago by gardea
Avatar
Sorry, I probably didn't express myself too well. I will send you an email with an attachment containing a screenshot as taken from the out-of-the-box sample. Eventually, please comment back on that. Thank you, Petru.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ahh thank you, it appears to show up when namespace prefixes are used. It's now fixed for the next maintenance release. We may push this out soon, even later today.


Actipro Software Support

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.