mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 13:56:33 -06:00
update display name on argument change
This commit is contained in:
parent
2b086cbdf3
commit
d682ded898
@ -421,25 +421,21 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (_IsNewCommand)
|
|
||||||
{
|
|
||||||
// for new commands, make sure we generate a new ID every time any arg value changes
|
|
||||||
actionArgsVM.WrapperValueChanged([weakThis = get_weak()](const IInspectable& /*sender*/, const IInspectable& /*args*/) {
|
actionArgsVM.WrapperValueChanged([weakThis = get_weak()](const IInspectable& /*sender*/, const IInspectable& /*args*/) {
|
||||||
if (auto weak = weakThis.get())
|
if (auto weak = weakThis.get())
|
||||||
|
{
|
||||||
|
// for new commands, make sure we generate a new ID every time any arg value changes
|
||||||
|
if (weak->_IsNewCommand)
|
||||||
{
|
{
|
||||||
weak->_command.GenerateID();
|
weak->_command.GenerateID();
|
||||||
}
|
}
|
||||||
});
|
else if (!weak->IsUserAction())
|
||||||
}
|
|
||||||
else if (!IsUserAction())
|
|
||||||
{
|
|
||||||
actionArgsVM.WrapperValueChanged([weakThis = get_weak()](const IInspectable& /*sender*/, const IInspectable& /*args*/) {
|
|
||||||
if (auto weak = weakThis.get())
|
|
||||||
{
|
{
|
||||||
weak->_ReplaceCommandWithUserCopy(false);
|
weak->_ReplaceCommandWithUserCopy(false);
|
||||||
}
|
}
|
||||||
});
|
weak->_NotifyChanges(L"DisplayName");
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandViewModel::_ReplaceCommandWithUserCopy(bool reinitialize)
|
void CommandViewModel::_ReplaceCommandWithUserCopy(bool reinitialize)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user