InsertText() fails to add line modification markers

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Marianne
Version: 4.0.0249
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
If the cursor is positioned at the very beginning of a document and InsertText() is called, line modifications markers do not appear for the inserted text.

------------------------------- Marianne

Comments (3)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marianne,

I'm not seeing that behavior. Could you provide repro steps? Thanks!


Actipro Software Support

Posted 17 years ago by Marianne
Avatar
I can repro it reliably in the sample app by taking the following steps (if I understood why it was happening I could repro it with fewer steps ;))

-Launch SDI Sample App
-Select and copy the TestClass summary comments
-Move the cursor to Line 0, column 0 (very top of document)
-Hit spacebar twice
-Move the cursor back to the start position by using the left arrow key (hit it twice)
-Paste copied data (this should work)
-Undo via CTRL-Z
-Hit the Delete key once (so the first line text is now one space closer to the cursor which is still at the top of the document
-Paste again (you will now see the problem)

This is not a big problem in itself but I have users that frequently copy and paste into the top of documents and when this bug hits it is often followed by the following exception. Hopefully this will allow to fix the first issue so that the exception will be taken care of as well:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
   at ActiproSoftware.SyntaxEditor.DocumentLineCollection.get_Item(Int32 index)
   at bk.b(Int32 A_0, Int32 A_1)
   at ActiproSoftware.SyntaxEditor.DisplayLineCollection.e(Int32 A_0)
   at ActiproSoftware.SyntaxEditor.EditorView.a(Boolean A_0, Boolean A_1)
   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.WinUICore.UIControl.OnLayout(LayoutEventArgs e)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.PerformLayout()
   at ActiproSoftware.WinUICore.UIContainerControl.UpdateLayout()
   at ActiproSoftware.WinUICore.UIContainerControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
   at ActiproSoftware.WinUICore.UIContainerControl.OnLayout(LayoutEventArgs e)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.PerformLayout()
   at ActiproSoftware.WinUICore.UIContainerControl.UpdateLayout()
   at ActiproSoftware.WinUICore.UIContainerControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
   at ActiproSoftware.WinUICore.UIContainerControl.OnLayout(LayoutEventArgs e)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.PerformLayout()
   at ActiproSoftware.WinUICore.UIControl.UpdateLayout()
   at ActiproSoftware.WinUICore.UIControl.Invalidate(InvalidationLevels levels, InvalidationTypes types)
   at ActiproSoftware.UIStudio.TabStrip.TabStripPage.set_Text(String value)
   at ActiproSoftware.UIStudio.Dock.TabbedMdiContainer.d()
   at ActiproSoftware.UIStudio.Dock.TabbedMdiWindow.UpdateUI()
   at ActiproSoftware.UIStudio.Dock.DocumentWindow.set_Modified(Boolean value)
   at di.a(Object A_0, EventArgs A_1)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.OnDocumentModifiedChanged(EventArgs e)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.n(Object A_0, EventArgs A_1)
   at ActiproSoftware.SyntaxEditor.Document.OnModifiedChanged(EventArgs e)
   at ActiproSoftware.SyntaxEditor.Document.set_Modified(Boolean value)
   at ActiproSoftware.SyntaxEditor.UndoRedo.b(DocumentModificationEventArgs A_0)
   at ActiproSoftware.SyntaxEditor.Document.a(DocumentModification A_0, Boolean A_1)
   at ActiproSoftware.SyntaxEditor.Document.a(k A_0, Boolean A_1)
   at ActiproSoftware.SyntaxEditor.UndoRedo.Undo()
   at ActiproSoftware.SyntaxEditor.Commands.UndoCommand.Execute(EditCommandContext context)
   at ActiproSoftware.SyntaxEditor.MacroRecording.a(EditCommand A_0, EditCommandContext A_1)
   at ActiproSoftware.SyntaxEditor.EditorView.a(EditCommand A_0, Boolean A_1)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.a(EditorView A_0, Keys A_1, Char A_2, Boolean A_3)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.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).

------------------------------- Marianne

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Marianne,

This should be fixed for the next maintenance release. I haven't seen the exception occur but if you see it happen after the update, please see if you can make a sample project that repros it and send it over. Thanks!


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.