diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-11-08 19:34:35 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-11-08 19:34:35 +0400 |
commit | dad244326c04e7b21ffcdb3a68f8f65a02869941 (patch) | |
tree | 2ed3909ab8348c137a9be3984b8c3bc995505f52 /main/src/addins/MonoDevelop.SourceEditor2 | |
parent | ee644cc9136121549f83a71855cbb03df6ad6068 (diff) | |
parent | ec035e02db5d9b6e9a2c2275d3145b44264dc546 (diff) |
Merge branch 'master' into newresolver
Conflicts:
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs
main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
Diffstat (limited to 'main/src/addins/MonoDevelop.SourceEditor2')
-rw-r--r-- | main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs index c035d0cadf..792bb6b1e9 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs @@ -660,17 +660,17 @@ namespace MonoDevelop.SourceEditor return false; } - void HandleTextPaste (int insertionOffset, string text) + void HandleTextPaste (int insertionOffset, string text, int insertedChars) { if (PropertyService.Get ("OnTheFlyFormatting", true)) { var prettyPrinter = CodeFormatterService.GetFormatter (Document.MimeType); if (prettyPrinter != null && Project != null && text != null) { try { var policies = Project.Policies; - string newText = prettyPrinter.FormatText (policies, Document.Text, insertionOffset, insertionOffset + text.Length); + string newText = prettyPrinter.FormatText (policies, Document.Text, insertionOffset, insertionOffset + insertedChars); if (!string.IsNullOrEmpty (newText)) { - Replace (insertionOffset, text.Length, newText); - Caret.Offset = insertionOffset + newText.Length; + int replaceResult = Replace (insertionOffset, insertedChars, newText); + Caret.Offset = insertionOffset + replaceResult; } } catch (Exception e) { LoggingService.LogError ("Error formatting pasted text", e); |