Actipro crash during multi-line select and enter

SyntaxEditor for WPF Forum

Posted 3 years ago by Banukobhan Nagendram
Version: 16.1.0633
Platform: .NET 4.5
Environment: Windows 10 (64-bit)
Avatar

Hi,

I'm facing a crash issue, if I select multi-line and press enter key.

The steps to reproduce the problem

1. Open the Actipro SampleApplication and 12-Indent Provider

The editor has the following context (Make sure the last line is an empty line.)

/*
In this sample we've built an indent provider service for the language that will auto-indent
when the end user presses Enter. It will indent a tab stop level if pressing Enter after
a '{' character.

If the caret is immediately in between a curly brace pair when pressing Enter, the close
curly brace will be moved to the line after the caret.

The indent provider also watches text changes and will auto-outdent a '}' character when typed.
*/

function Add(x, y) {
return x + y;

// Type a '}' character on the next line to see how the character is outdented

}

function Increment(x) {
return (x + 1);
}

function IncrementAndMultiply(x, y) {
// This function calls another function
var result;
result = Increment(x);
return result * y;
}

2. Select portion of function Increment(x) as following. (Make sure the selected lastline ( } ) is fully selected)

Increment(x) {
	return (x + 1);
}

3. Press entry key in the keyboard

4. Application crash with the Exception "ArgumentOutofRangeException".
StackTrace: 
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at #BZc.#EZc.#sxj(Int32 #4Te, Int32 #0Te, Int32 #1Te, Boolean #txj, Nullable'1 #uxj)
at #BZc.#EZc.#B6c(Object #xhb, TextSnapshotChangedEventArgs #yhb)
at System.EventHandler'1.Invoke(Object sender, TEventArgs e)
at ActiproSoftware.Text.Implementation.TextDocumentBase.OnTextChanged(TextSnapshotChangedEventArgs e)
at ActiproSoftware.Text.Implementation.TextDocumentBase.#O7c(#g7b #g7b)
at ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives.EditorView.BasicReplaceSelectedText(ITextChangeType type, String text, IEditorViewTextChangeOptions options)
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.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.Input.RoutedCommand.ExecuteImpl(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.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.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
at System.Windows.Interop.ThreadMessageEventHandler.Invoke(MSG& msg, Boolean& handled)
at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at ActiproSoftware.SampleBrowser.WindowsApp.Main() in c:\Users\nbanukh\Documents\Actipro Software\WPF-Controls\v16.1.0633\SampleBrowser\obj\Debug\SampleBrowser\WindowsApp.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


Message:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Comments (1)

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

Hello,

Thank you for reporting this issue.  We just found the cause.  This is a serious bug that we wanted to get the fix out immediately so we issued a hotfix for build 633.  Please uninstall the build you have and redownload build 633 to get the fix.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.