Browse Source

fix SD-1894 - ArgumentOutOfRangeException when indenting .xaml file

pull/6/merge
Siegfried Pammer 13 years ago
parent
commit
06440c49d8
  1. 7
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs

7
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs

@ -149,12 +149,7 @@ namespace ICSharpCode.XmlEditor @@ -149,12 +149,7 @@ namespace ICSharpCode.XmlEditor
else
newText = currentIndentation + lineText.Trim();
if (newText != lineText) {
int extraCharsToBeAddedAtStartedOfLine = newText.Length - lineText.Length;
document.Replace(line.Offset, line.Length, newText);
Location caretPosition = document.OffsetToPosition(line.Offset + extraCharsToBeAddedAtStartedOfLine);
editor.Caret.Position = caretPosition;
}
document.SmartReplaceLine(line, newText);
nextLine++;
}
if (r.LineNumber > end)

Loading…
Cancel
Save