Forum > SynEdit
SynEdit MarkupManager RemoveMarkUp MarkupByClass
(1/1)
BubikolRamios:
Why is this looping indefinitely ? Does not go to exception.
I guess It should remove type of TSynEditMarkupHighlightAll until none is left ?
assuming
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---MarkupManager.MarkupByClass[TSynEditMarkupHighlightAll] returns only one of n there.
How to do that ?
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- while 1 = 1 do begin try SynEdit1.MarkupManager.RemoveMarkUp(SynEdit1.MarkupManager.MarkupByClass[TSynEditMarkupHighlightAll]); except on E: Exception do begin showmessage('foo'); end; end; end;
Martin_fr:
--- Quote from: BubikolRamios on July 18, 2022, 02:22:54 am ---Why is this looping indefinitely ? Does not go to exception.
--- End quote ---
Why should it?
I haven't verified that, but I guess MarkupByClass eventually returns nil, and RemoveMarkup does nothing.
If so, you can check yourself if the value is nil.
You are aware, that once you done that, you must ensure not to call SynEdit.SetHighlightSearch (or related).
They have a pointer (dangling pointer, after you removed it) to the markup.
Navigation
[0] Message Index