Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Pressing Ctrl+Z in InsertWithCursor mode causes InvalidOperationException #282

@dgrunwald

Description

@dgrunwald
  1. Use the 'Extract method' refactoring
  2. While InsertWithCursor is active, press Ctrl+Z for undo
SharpDevelop Version : 5.0.0.3569-alpha-33e7676c
.NET Version         : 4.0.30319.18408
OS Version           : Microsoft Windows NT 6.1.7601 Service Pack 1
Current culture      : English (United States) (en-US)
Running under WOW6432, processor architecture: x86-64
Working Set Memory   : 369756kb
GC Heap Memory       : 125448kb

Unhandled WPF exception
Exception thrown:
System.InvalidOperationException: No undo group should be open at this point
   at ICSharpCode.AvalonEdit.Document.UndoStack.ThrowIfUndoGroupOpen() in c:\work\SD5\src\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\Document\UndoStack.cs:line 242
   at ICSharpCode.AvalonEdit.Document.UndoStack.Undo() in c:\work\SD5\src\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\Document\UndoStack.cs:line 276
   at ICSharpCode.AvalonEdit.Editing.TextAreaDefaultInputHandler.ExecuteUndo(Object sender, ExecutedRoutedEventArgs e) in c:\work\SD5\src\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\Editing\TextAreaDefaultInputHandlers.cs:line 82
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

---- Recent log messages:
22:36:30.434 [1] DEBUG - CompilerMessageView: Combined 5 appends.
22:36:30.447 [1] DEBUG - CompilerMessageView: Combined 22 appends.
22:36:30.460 [1] DEBUG - CompilerMessageView: Combined 10 appends.
22:36:30.474 [1] DEBUG - CompilerMessageView: Combined 11 appends.
22:36:30.733 [1] DEBUG - CompilerMessageView: Combined 30 appends.
22:36:30.735 [1] DEBUG - CompilerMessageView: Combined 4 appends.
22:36:30.747 [1] DEBUG - CompilerMessageView: Combined 29 appends.
22:36:30.760 [1] DEBUG - CompilerMessageView: Combined 5 appends.
22:36:30.773 [1] DEBUG - CompilerMessageView: Combined 33 appends.
22:36:30.786 [1] DEBUG - CompilerMessageView: Combined 5 appends.
22:36:30.797 [1] DEBUG - CompilerMessageView: Combined 3 appends.
22:36:30.851 [1] DEBUG - CompilerMessageView: Combined 80 appends.
22:36:30.852 [1] DEBUG - CompilerMessageView: Combined 6 appends.
22:36:30.873 [1] DEBUG - CompilerMessageView: Combined 136 appends.
22:36:30.881 [1] DEBUG - CompilerMessageView: Combined 5 appends.
22:36:33.637 [UnitTesting Pipe Reader] DEBUG - End of pipe
22:36:33.705 [1] DEBUG - CompilerMessageView: Combined 2 appends.
22:36:33.711 [1] DEBUG - CompilerMessageView: Combined 68 appends.
22:36:33.881 [6] DEBUG - Waiting for pipe reader to finish
22:36:33.881 [6] DEBUG - Pipe reader has finished
22:36:33.883 [1] DEBUG - ActiveContentChanged to ICSharpCode.SharpDevelop.Gui.ErrorListPad
22:37:12.068 [1] DEBUG - ActiveContentChanged to ICSharpCode.SharpDevelop.Project.ProjectBrowserPad
22:37:14.408 [1] DEBUG - ActiveContentChanged to [AvalonEditViewContent C:\work\NRefactory\ICSharpCode.NRefactory.Tests\CSharp\Parser\Expression\UndocumentedExpressionTests.cs]
22:37:17.266 [1] DEBUG - Resolved (Line 34, Col 21) to [ConstantResolveResult System.String = public static int GetArgCount(__arglist)
                {
                    ArgIterator argIterator = new ArgIterator(__arglist);
                    return argIterator.GetRemainingCount();
                }]
22:37:18.922 [1] ERROR - Unhandled WPF exception
--> Exception:
System.InvalidOperationException: No undo group should be open at this point
   at ICSharpCode.AvalonEdit.Document.UndoStack.ThrowIfUndoGroupOpen() in c:\work\SD5\src\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\Document\UndoStack.cs:line 242
   at ICSharpCode.AvalonEdit.Document.UndoStack.Undo() in c:\work\SD5\src\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\Document\UndoStack.cs:line 276
   at ICSharpCode.AvalonEdit.Editing.TextAreaDefaultInputHandler.ExecuteUndo(Object sender, ExecutedRoutedEventArgs e) in c:\work\SD5\src\Libraries\AvalonEdit\ICSharpCode.AvalonEdit\Editing\TextAreaDefaultInputHandlers.cs:line 82
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

---- Post-error application state information:
Installed 3rd party AddIns: 
ProjectService.CurrentSolution: [Solution C:\work\NRefactory\NRefactory.sln with 13 projects]
ProjectService.CurrentProject: <null>
Workbench.ActiveContent: [AvalonEditViewContent C:\work\NRefactory\ICSharpCode.NRefactory.Tests\CSharp\Parser\Expression\UndocumentedExpressionTests.cs]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions