This project is read-only.

Why is TextChanged Event fired multiple times?

May 23, 2013 at 10:20 PM
Edited May 23, 2013 at 10:21 PM
Hello,

I'm trying to implement a dynamic recognition of user functions (just as intellisense of visual studio). To achieve this, I tried both the TextChanged and the DocumentChange Events, but for some reason I don't understand they get (both) fired multiple times.

I enter a single Char the event is fired 2 or sometimes four times. If I copy-paste a bigger amount of text to the controll, it gets fired 20 times or even more often.

This heavily affects performance and makes my project basically impossible, so... what causes this problem?

I used MessageBox.Show(myScintilla.Text) to display the text each time the event is fired, and after the first time it stays the same - but regardless of this the event gets fired again and again.

What can I do against this?

Best,
2mQ
May 25, 2013 at 12:44 AM
Please see ticket 33179 (https://scintillanet.codeplex.com/workitem/33179) and see if that answers your questions.

Jacob
May 25, 2013 at 12:41 PM
Hello,

thanks for the answer, this seems to be exactly what I was looking for. So I have to change the source code manually as explained here, right? May I ask you were exactly I have to put in the changes, do I have to modify the ScintillaNET.dll?

Best,
2mQ
May 25, 2013 at 4:56 PM
Interesting.... it looks like CodePlex has screwed up the status of some of our work items. This item (and about a dozen others) should be in the 'Fixed' status--indicating that the code changes have been made in Trunk but not published yet as part of a release ('Closed' status). But this item and many others have been mysteriously updated to a status of 'Closed' and their is no record that the changes were made by any of the project coordinators. I'll have to have a word with some of the CodePlex people as to why that happened.

Seeing that our issues list has been mangled, I'm inclined to make another release (2.6 or something) to pick up all our latest changes and get the release package back in sync with our issues list.

If you would like this change before then you'll need to build Trunk yourself.



Jacob
Aug 19, 2013 at 4:22 PM
Edited Aug 19, 2013 at 6:38 PM
Hi again,

I'm still trying to fix this behaviour as I can't achieve this behaviour on Lexer Level and I inserted the proposed code as specified under the link above...

But when I insert the code I just get the error messages from the compiler "ScintillaNET.NativeMethods doesn't contain a definition for SC_MOD_DELETETEXT" (Same for SC_MOD_INSERTTEXT)

So... where can I find those constants?

Greetings,
2mQ

EDIT:
Ok never mind, I replaced SC_MOD_DELETETEXT with 0x2 and SC_MOD_INSERTTEXT with 0x1 and it works now. Just to mention it here, as it seems this constants aren't defined inside the NativeInterface.