Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <ward.matt@gmail.com>2015-04-17 12:08:05 +0300
committerMatt Ward <ward.matt@gmail.com>2015-04-17 12:08:10 +0300
commit42fe1bed79bb077b3541c8f2c13bb06a145e611d (patch)
treee547240893698afc965feea00c490a1eeec47a65
parent1e544c02595623cd6539e518607af78d35f3e5e9 (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.cs5
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;
}
}
}