Forum > LCL
TSynEdit crashes when loading text
Martin_fr:
A temporary patch. I still need to do some testing.
--- Code: Diff [+][-]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";}};} ---diff --git a/components/synedit/synhighlightermulti.pas b/components/synedit/synhighlightermulti.pasindex 1343e5d554..ca662dc37d 100644--- a/components/synedit/synhighlightermulti.pas+++ b/components/synedit/synhighlightermulti.pas@@ -845,22 +845,22 @@ procedure TSynHLightMultiVirtualLines.RealLinesDeleted(AIndex, ACount: Integer); // Real-lines starting in the middle of the Section CountInSection := Min(AIndex + ACount, p^.EndPos.y + 1) - AIndex; FirstVLine := p^.VirtualLine + AIndex - p^.StartPos.y;- PrevEndVLine := p^.VirtualLine + p^.EndPos.y - p^.EndPos.y;+ PrevEndVLine := p^.VirtualLine + p^.EndPos.y - p^.StartPos.y; p^.EndPos.y := p^.EndPos.y - CountInSection; inc(i); if i = FSectionList.Count then begin DelVLines; exit; end; p := FSectionList.PSections[i]; VLineCount := CountInSection; end; while p^.EndPos.y < AIndex + ACount do begin // Completly delete node (All Real lines deleted) VLineCount := VLineCount + p^.EndPos.y - p^.StartPos.y + 1; if PrevEndVLine = p^.VirtualLine then dec(VLineCount);- PrevEndVLine := p^.VirtualLine + p^.EndPos.y - p^.EndPos.y;+ PrevEndVLine := p^.VirtualLine + p^.EndPos.y - p^.StartPos.y; FSectionList.Delete(i); if i = FSectionList.Count then begin DelVLines;
domasz:
Seems to work great, thank you for such a quick fix!
I tried it with hundreds of files from real websites and I found no problems.
Martin_fr:
Found a few other issues too. For patch, see the commit mentioned in the reported issue.
Navigation
[0] Message Index
[*] Previous page