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.
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.