SynEdit produces an error on save file (and fix) lazarus / 31-LCL ---------------------------------------------------------------------- aducom · 2019-05-26 07:02 I have made a bug report that explains that under some circumstances a Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i mySynEdit.Lines.SaveToFile Generates an error. I traced this down to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TCustomSynEdit.MarkTextAsSaved;begin  TSynEditStringList(fLines).MarkSaved;  if FLeftGutter.Visible and FLeftGutter.ChangesPart(0).Visible then  ...  The FLeftGutter.Changespart can be nil under certain circumstances causing an error if you access .visible. I don't know if this situation should occur or is caused by some mishap in my code or somewhere else, but this fix solved it for me: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TCustomSynEdit.MarkTextAsSaved;begin  TSynEditStringList(fLines).MarkSaved;  if FLeftGutter.ChangesPart=nil then exit;  if FLeftGutter.Visible and FLeftGutter.ChangesPart(0).Visible then ---------------------------------------------------------------------- lucamar · 2019-05-26 07:31 A link to the bug report  would be nice ... ---------------------------------------------------------------------- aducom · 2019-05-26 07:56 https://bugs.freepascal.org/view.php?id=35635 ---------------------------------------------------------------------- jamie · 2019-05-26 17:55 It works fine for me when dropping an SynEdit in the form via OI. All parts are there. are you doing something to remove these parts? ---------------------------------------------------------------------- aducom · 2019-05-27 20:03 No, but I ported my code from 32 to 64 bits and upgraded lazarus. I think something must have gone wrong. I managed by adding the missing parts in the lfm file. However, there is an issue because you can remove a part, but you are not able to add it again because you can only add line number part. But that's another issue ;-) A tiny bit of hacking and the issue was solved.