Altering synEdit highlighter when a document is loaded causes infinite loop
Original Reporter info from Mantis: wotanica
-
Reporter name: Jon Lennart Aasenden
Original Reporter info from Mantis: wotanica
- Reporter name: Jon Lennart Aasenden
Description:
Setup:
- SynEditor
- Multisyn componen (connect to #1 (closed))
- Pascal highlighter (Connect to #2 (closed))
- XML highlight (unconnected)
- A button with the following onClick code:
Procedure TForm1.Button1Click(Sender:TObject)
Begin
multiSyn1.Highlighter:=synXMLighlighter;
End;
Run the program and Load in an XML file (or just type a small XML snippet in the editor). Now click the button to change the highlighter in "realtime".
The entire application locks up, and if you are running from the IDE - that is locked to. All the CPU is drained, and terminating the application is the only way out (which on my PC also took with it lazarus).
Additional information:
The way to get around this bug is to use the following code when changing highlighter on the fly:
synEditor.Highlighter:=NIL;
multiSyn1.Highlighter:="New highlighter here";
SynEditor.Highlighter:=multisyn1;
There seem to be something funky going on in the notification between components. This type of bug is not uncommon in Delphi if the notification code is sloppy.
Mantis conversion info:
- Mantis ID: 17419
- Version: 0.9.28.2
- Fixed in version: 0.9.29 (SVN)
- Fixed in revision: 27545 (#1b6d6917)
- Target version: 0.9.30
- LazTarget: 1.0