mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Create highlighters.xml backup on configuration version change
This commit is contained in:
parent
8f8fa5a062
commit
cef1e497e2
1 changed files with 8 additions and 1 deletions
|
|
@ -839,8 +839,8 @@ end;
|
|||
procedure THighlighters.Load(const FileName: String);
|
||||
var
|
||||
J: LongInt;
|
||||
AVersion: Integer;
|
||||
Config: TXmlConfig;
|
||||
AVersion: Integer = ConfigVersion;
|
||||
Highlighter: TSynCustomHighlighter;
|
||||
LanguageName, AttributeName: String;
|
||||
Attribute: TSynHighlighterAttributes;
|
||||
|
|
@ -897,6 +897,13 @@ begin
|
|||
end;
|
||||
// Import colors from old format
|
||||
if AVersion < 2 then SaveColors;
|
||||
// Create config backup
|
||||
if (AVersion < ConfigVersion) then
|
||||
try
|
||||
Config.WriteToFile(FileName + '.bak');
|
||||
except
|
||||
// Ignore
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
Config.Free;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue