Good afternoon (o;
The CodeEditor has an event called TextChanged…which fires three times when I add text from a file.
But…when I type in the editor, this event is never fired, only when I press the delete key.
The TextInserted event never fires though.
Am I miss something here?
Just need to detect when the text in SyntaxArea.Editor has changed and needs to be saved.
For me it works as expected. But I have only tested TextChange event.
- Started with a fresh download from Git
- Install the “TextInputCanvas.xojo_plugin”
- Use Xojo 2024 R 2.1 on macOS 14.6 Sonoma
- Start Demo window from ““SyntaxArea.xojo_project””
- add the TextChange event and count changes in the title of the window
When DebugBuild it starts with 2 strokes
type in 11 strokes (1 to 0 + return) = 13
Have you inserted code somewhere that blocks the event?
Are you using the latest versions?
I’m using the latest github version…
Just one Editor the event fires fine, even with my MouseMove event change to show the correct IBeam cursor…
But in my app when I programmatically add an editor via Controlset, the event fires only on backspace/delete.
Hmm…when I add following line at the end of HandleInsertText method, it fires then normally:
RaiseEvent TextChanged
Have you implemented and initialized the UndoKit?
/// Create a new global undo manager for the application.
UndoManager = New UndoKit.UndoManager
Then “TextChange” works also at an editor created by code at runtime (as controlset).
Without the UndoKit, I got the same behaviour - only backspace/delete works.
Ah that could be it…haven’t enabled it so far…
Can test in two days as I have to leave tomorrow early to office…well once a month is enough (o;
Good morning…
Can also confirm that when using UndoManager the TextChanged fires now when typing and also when selection text and deleting it.
Without it the RaiseEvent has to be added in the HandleTextInsert and HandleDelete methods.
Will raise a Github issue…