syntaxEditor crashed when Document.Text is set

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Charles W. Hooks
Version: 4.0.0235
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
I looked thru the forums and didn't see the bug I am experiencing reported.

I have the syntax editor placed on a tab.

The following line work successfully when the tab that has the syntax editor has focus:

syntaxEditor.Document.Text = script;

When a different tab has focus and that line is called I get the following stack trace:

System.IndexOutOfRangeException: Index was outside the bounds of the array.
at bf.b(Int32 A_0)
at bm.a(Int32 A_0)
at ActiproSoftware.SyntaxEditor.DisplayLineCollection.e(Int32 A_0)
at ActiproSoftware.SyntaxEditor.EditorView.OffsetToPosition(Int32 offset)
at ActiproSoftware.SyntaxEditor.Selection.a(Int32 A_0, Int32 A_1, Int32 A_2)
at ActiproSoftware.SyntaxEditor.Selection.get_EndEditPosition()
at ActiproSoftware.SyntaxEditor.EditorView.get_HorizontalScrollBarMaximum()
at ActiproSoftware.SyntaxEditor.EditorView.ArrangeCore()
at ActiproSoftware.WinUICore.UIElement.Arrange(Rectangle newBounds)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.ArrangeCore()
at ActiproSoftware.WinUICore.UIControl.Arrange(Rectangle newBounds)
at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.a(co A_0)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.d(Object A_0, DocumentModificationEventArgs A_1)
at ActiproSoftware.SyntaxEditor.Document.b(DocumentModificationEventArgs A_0)
at ActiproSoftware.SyntaxEditor.Document.a(DocumentModification A_0, Boolean A_1)
at ActiproSoftware.SyntaxEditor.Document.set_Text(String value)
at Kaleidoscope.Model.Screen.SubControls.TextEditor.KcEditorControl.SetScript(String script)
at AbacusStudio.Designers.SurfaceDesigner.SurfaceDesignerControl.RunAtChanged(RunAtType runAt)
at AbacusStudio.Designers.SurfaceDesigner.FieldDetailsEditorControl.OnRunAtChanged(RunAtType runAt)
at AbacusStudio.Components.EventListControl.OnRunAtChanged(RunAtType runAt)
at AbacusStudio.Components.EventListControl.comboBoxScriptType_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
at System.Windows.Forms.ComboBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Even if I catch the exception, the syntax editor become corrupt, switching the tab with the syntax editor on it, generates endless exceptions that basically kills the app and the syntax editor has a red X thru it with no text displayed.

Comments (3)

Posted 12 years ago by Charles W. Hooks
Avatar
If the text I am setting it larger than the existing, no crash occurs. If the text I am setting is less (a java script function was removed) the crash occurs. However, the crash only occurs if the script editor is not visible. If the editor is visible and has focus, setting a smaller text works fine.

Our usage if that we use a drop down to switch between several java sript files for the user to edit, i.e. client side and server side java script.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Charles,

First please try the latest maintenance release to see if it happens there. If it still does then please email us a simple sample project that shows it happening so that we can debug it.

I think this bug was fixed a few maintenance releases ago.

Thanks!

[Modified at 08/31/2007 01:44 PM]


Actipro Software Support

Posted 12 years ago by Charles W. Hooks
Avatar
Thank you for the quick customer support reply. The latest build does indeed fix this bug. Thank you very much, greatly appreciated!
The latest build of this product (v2018.1 build 0341) was released 6 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.