mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
Only do "keys" fixups for non-nested, non-iterable commands (#19408)
## Summary of the Pull Request When we introduced action IDs, we separated "commands" from "keybindings", and introduced fixup logic to rewrite the legacy-style command blocks into the new version. However we don't do any ID logic for nested and iterable commands, so make sure we don't inform the loader for fixups in those cases. ## Validation Steps Performed We no longer repeatedly attempt to fixup the settings file when we see a `"keys"` entry in a nested/iterable command block ## PR Checklist - [x] Closes #18736 (cherry picked from commit 04676bd31a598ccede4517367cbb070c38964f8e) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgfjxUQ Service-Version: 1.22
This commit is contained in:
parent
c3e97dd39e
commit
94f4eb315f
@ -82,18 +82,13 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
|||||||
command->LogSettingChanges(_changeLog);
|
command->LogSettingChanges(_changeLog);
|
||||||
AddAction(*command, keys);
|
AddAction(*command, keys);
|
||||||
|
|
||||||
if (jsonBlock.isMember(JsonKey(KeysKey)))
|
if (jsonBlock.isMember(JsonKey(ActionKey)) && !jsonBlock.isMember(JsonKey(IterateOnKey)) && origin == OriginTag::User &&
|
||||||
{
|
(!jsonBlock.isMember(JsonKey(IDKey)) || jsonBlock.isMember(JsonKey(KeysKey))))
|
||||||
// there are keys in this command block meaning this is the legacy style -
|
|
||||||
// inform the loader that fixups are needed
|
|
||||||
_fixupsAppliedDuringLoad = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jsonBlock.isMember(JsonKey(ActionKey)) && !jsonBlock.isMember(JsonKey(IterateOnKey)) && origin == OriginTag::User && !jsonBlock.isMember(JsonKey(IDKey)))
|
|
||||||
{
|
{
|
||||||
// for non-nested non-iterable commands,
|
// for non-nested non-iterable commands,
|
||||||
// if there's no ID in the command block we will generate one for the user -
|
// if there's no ID in the command block we will generate one for the user,
|
||||||
// inform the loader that the ID needs to be written into the json
|
// or if there are keys in this command block that means this is the legacy style -
|
||||||
|
// in either case, inform the loader that fixups are needed
|
||||||
_fixupsAppliedDuringLoad = true;
|
_fixupsAppliedDuringLoad = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user