Editor Throwing Error On Backspace

SyntaxEditor for WPF Forum

Posted 11 years ago by Ryan Howard
Version: 12.2.0571
Avatar

Hi,
I'm having a really odd issue with my Syntax Editor...If I type and add text like normal, everything acts as expected. However, if I open the editor, hit the return key once, it'll create a new line, if I hit the return key it stops creating new lines and does nothing.....At that point, if I hit the backspace key(to essentially remove the extra line), it throws an error and crashes my app. I've been trying to trace this through and figure out where my code is causing the problem, but I can't see where, just your libraries are showing up. Have y'all seen a similar problem before? Here's the stack trace:

  at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
at System.String.Substring(Int32 startIndex, Int32 length)
at #PZc.#VZc.ToString(Int32 #Oqc, Int32 #Nqc)
at ActiproSoftware.Text.Implementation.TextDocumentBase.#O7c(#g7b #g7b)
at #Q2b.#g7b.Apply()
at ActiproSoftware.Text.Implementation.TextDocumentBase.ReplaceText(ITextChangeType type, Int32 offset, Int32 length, String text, ITextChangeOptions options)
at ActiproSoftware.Text.Implementation.TextDocumentBase.DeleteText(ITextChangeType type, Int32 offset, Int32 length, ITextChangeOptions options)
at ActiproSoftware.Windows.Controls.SyntaxEditor.EditActions.BackspaceAction.Execute(IEditorView view)
at ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.ExecuteEditAction(IEditAction action)
at ActiproSoftware.Windows.Controls.SyntaxEditor.Implementation.EditActionBase.#Bfc(Object #xhb, ExecutedRoutedEventArgs #yhb)
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)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at CloudingoStudio.App.Main() in C:\TFS\CloudingoStudio\Main\Source\CloudingoStudio\CloudingoStudio\obj\x86\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

 

Thanks,

Ryan

Comments (6)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ryan,

That sounds similar to something we fixed a while back (after the build you said you're on).  Please try getting the latest 2012.2 maintenance release or the 2013.1 version.


Actipro Software Support

Posted 11 years ago by Ryan Howard
Avatar

Thanks for getting back to me. I updated all my Actipro library references with the newly downloaded 2013.1 assemblies. However I'm still seeing the issue. Do I need to do something else?

 

Thanks,

Ryan

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ryan,

We didn't see it when testing here.  Can you make a new simple sample project that shows it happening and e-mail that to our support address?  Reference this post and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 11 years ago by Ryan Howard
Avatar

I'm not sure if I can package up our solution with the security on it, however the start of the problem is that after I hit the return key, and enter a second line, it won't allow me to enter anymore lines. So 2 lines, and that's it, it won't let me enter any more lines no matter how many times I hit the enter key. Have yall seen that?

 

-Ryan

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ryan,

No we haven't seen that and have tried to repro it here but haven't been able to. 

Note that we don't want to get your full solution though.  We are asking that you make a new app project, put a SyntaxEditor on a Window and add the minimum amount of code to make the issue show up.  That will allow us ot debug it.


Actipro Software Support

Answer - Posted 11 years ago by Ryan Howard
Avatar

Fixed....This was a really bizare issue with the way I was handling the current Syntax Editor's text. I had bound the text to a Model property, and then when updating it, I handled it improperly by treading new lines as null or white space, and didn't update the actual Model's content. That probably doesn't make any sense, but we have to do some strange things to get our editor to behave properly for our scenario. Thanks for the support!

 

-Ryan

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.