diff options
author | Matt Ward <ward.matt@gmail.com> | 2015-04-17 12:08:05 +0300 |
---|---|---|
committer | Matt Ward <ward.matt@gmail.com> | 2015-04-17 12:08:10 +0300 |
commit | 42fe1bed79bb077b3541c8f2c13bb06a145e611d (patch) | |
tree | e547240893698afc965feea00c490a1eeec47a65 | |
parent | 1e544c02595623cd6539e518607af78d35f3e5e9 (diff) |
[XmlEditor] Fix caret position when smart indent is enabled
With smart indenting enabled (not virtual) the caret would be
positioned at the start of the line and not at the end after
the indented text. It is now positioned after the indented text.
-rw-r--r-- | main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs index 389485a8a1..ae8585c425 100644 --- a/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs +++ b/main/src/addins/Xml/Editor/BaseXmlEditorExtension.cs @@ -234,13 +234,8 @@ namespace MonoDevelop.Xml.Editor var oldIndent = Editor.GetLineIndent (newLine); var seg = Editor.GetLine (newLine); if (oldIndent != indent) { - int newCaretOffset = Editor.CaretOffset; - if (newCaretOffset > seg.Offset) { - newCaretOffset += (indent.Length - oldIndent.Length); - } using (var undo = Editor.OpenUndoGroup ()) { Editor.ReplaceText (seg.Offset, oldIndent.Length, indent); - Editor.CaretOffset = newCaretOffset; } } } |