diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-26 15:57:32 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-26 15:57:32 +0400 |
commit | 5ba64e4f967e49c0ddc96179fe919a0837463e27 (patch) | |
tree | 284278e01c75bd78f6054e39ae5bead0bc7f7cb2 /main/src/addins/AspNet | |
parent | 6cf6e34954b32247d8970a0712e1a12cebe4b52d (diff) | |
parent | 21ad778ec4c166c9e06218ccc173a547c2c0f6ec (diff) |
Merge branch 'master' into newresolver
Conflicts:
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs
main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MemberCompletionData.cs
main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectInfoService.cs
Diffstat (limited to 'main/src/addins/AspNet')
3 files changed, 25 insertions, 26 deletions
diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs index a83c6fb294..912760e505 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs +++ b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/DocumentReferenceManager.cs @@ -368,14 +368,14 @@ namespace MonoDevelop.AspNet.Parser if (pos < 0) return; - editor.Document.BeginAtomicUndo (); - var oldCaret = editor.Caret.Offset; - - var inserted = editor.Insert (pos, editor.EolMarker + directive.ToString ()); - if (preserveCaretPosition) { - editor.Caret.Offset = (pos < oldCaret)? oldCaret + inserted : oldCaret; + using (var undo = editor.OpenUndoGroup ()) { + var oldCaret = editor.Caret.Offset; + + var inserted = editor.Insert (pos, editor.EolMarker + directive.ToString ()); + if (preserveCaretPosition) { + editor.Caret.Offset = (pos < oldCaret)? oldCaret + inserted : oldCaret; + } } - editor.Document.EndAtomicUndo (); } DirectiveNode GetRegisterInsertionPointNode () diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs index 49510bf98f..14dbb1c924 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs +++ b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet.Parser/SuggestedHandlerCompletionData.cs @@ -77,11 +77,11 @@ namespace MonoDevelop.AspNet.Parser { //insert the method name MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer; - if (buf != null) {
- buf.BeginAtomicUndo ();
- buf.DeleteText (window.CodeCompletionContext.TriggerOffset, buf.CursorPosition - window.CodeCompletionContext.TriggerOffset); - buf.InsertText (buf.CursorPosition, methodInfo.Name);
- buf.EndAtomicUndo ();
+ if (buf != null) { + using (var undo = buf.OpenUndoGroup ()) {
+ buf.DeleteText (window.CodeCompletionContext.TriggerOffset, buf.CursorPosition - window.CodeCompletionContext.TriggerOffset); + buf.InsertText (buf.CursorPosition, methodInfo.Name); + }
} //generate the codebehind method diff --git a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.Html/DocTypeCompletionData.cs b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.Html/DocTypeCompletionData.cs index 47017a2e87..4464342cc6 100644 --- a/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.Html/DocTypeCompletionData.cs +++ b/main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.Html/DocTypeCompletionData.cs @@ -72,21 +72,20 @@ namespace MonoDevelop.Html { MonoDevelop.Ide.Gui.Content.IEditableTextBuffer buf = window.CompletionWidget as MonoDevelop.Ide.Gui.Content.IEditableTextBuffer; if (buf != null) {
- buf.BeginAtomicUndo (); - - int deleteStartOffset = window.CodeCompletionContext.TriggerOffset; - if (text.StartsWith (docTypeStart)) { - int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length; - if (start >= 0) { - string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset); - if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0) - deleteStartOffset -= docTypeStart.Length; + using (var undo = buf.OpenUndoGroup ()) { + int deleteStartOffset = window.CodeCompletionContext.TriggerOffset; + if (text.StartsWith (docTypeStart)) { + int start = window.CodeCompletionContext.TriggerOffset - docTypeStart.Length; + if (start >= 0) { + string readback = buf.GetText (start, window.CodeCompletionContext.TriggerOffset); + if (string.Compare (readback, docTypeStart, StringComparison.OrdinalIgnoreCase) == 0) + deleteStartOffset -= docTypeStart.Length; + } } - } -
- buf.DeleteText (deleteStartOffset, buf.CursorPosition - deleteStartOffset); - buf.InsertText (buf.CursorPosition, text);
- buf.EndAtomicUndo ();
+
+ buf.DeleteText (deleteStartOffset, buf.CursorPosition - deleteStartOffset); + buf.InsertText (buf.CursorPosition, text); + }
} } } |