JSONViewer: removed unnecessary call to ShowJSONDocumentText because it is then called again in TJSONTab.DoTabChange and added BeginUpdate/EndUpdate

This commit is contained in:
alligator 2025-05-20 12:59:42 +00:00 committed by Maxim Ganetsky
parent 476a492d5b
commit 354f8e5959

View File

@ -1637,7 +1637,6 @@ end;
procedure TJSONTab.ShowJSONDocument;
begin
ShowJSONDocumentText;
With TVJSON.Items do
begin
BeginUpdate;
@ -1678,9 +1677,14 @@ procedure TJSONTab.ShowJSONDocumentText;
begin
IF Assigned(Root) then
begin
FSyn.Text:=Root.FormatJSON();
FSyn.Modified:=false;
FSyn.CommandProcessor(ecRight,#0,Nil);
FSyn.BeginUpdate;
try
FSyn.Text:=Root.FormatJSON();
FSyn.Modified:=false;
FSyn.CommandProcessor(ecRight,#0,Nil);
finally
FSyn.EndUpdate;
end;
end;
end;