mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07:00
refactor: refactor settings to a nested structure (#7244)
This commit is contained in:
@@ -399,22 +399,7 @@ export function saveModifiedSettings(
|
||||
const isDefaultValue = value === getDefaultValue(settingKey);
|
||||
|
||||
if (existsInOriginalFile || !isDefaultValue) {
|
||||
// This is tricky because setValue only works on top-level keys.
|
||||
// We need to set the whole parent object.
|
||||
const [parentKey] = path;
|
||||
if (parentKey) {
|
||||
const newParentValue = setPendingSettingValueAny(
|
||||
settingKey,
|
||||
value,
|
||||
loadedSettings.forScope(scope).settings,
|
||||
)[parentKey as keyof Settings];
|
||||
|
||||
loadedSettings.setValue(
|
||||
scope,
|
||||
parentKey as keyof Settings,
|
||||
newParentValue,
|
||||
);
|
||||
}
|
||||
loadedSettings.setValue(scope, settingKey, value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user