Skip to content

Commit d682ded

Browse files
update display name on argument change
1 parent 2b086cb commit d682ded

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

src/cascadia/TerminalSettingsEditor/ActionsViewModel.cpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -421,25 +421,21 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
421421
}
422422
}
423423
});
424-
if (_IsNewCommand)
425-
{
426-
// for new commands, make sure we generate a new ID every time any arg value changes
427-
actionArgsVM.WrapperValueChanged([weakThis = get_weak()](const IInspectable& /*sender*/, const IInspectable& /*args*/) {
428-
if (auto weak = weakThis.get())
424+
actionArgsVM.WrapperValueChanged([weakThis = get_weak()](const IInspectable& /*sender*/, const IInspectable& /*args*/) {
425+
if (auto weak = weakThis.get())
426+
{
427+
// for new commands, make sure we generate a new ID every time any arg value changes
428+
if (weak->_IsNewCommand)
429429
{
430430
weak->_command.GenerateID();
431431
}
432-
});
433-
}
434-
else if (!IsUserAction())
435-
{
436-
actionArgsVM.WrapperValueChanged([weakThis = get_weak()](const IInspectable& /*sender*/, const IInspectable& /*args*/) {
437-
if (auto weak = weakThis.get())
432+
else if (!weak->IsUserAction())
438433
{
439434
weak->_ReplaceCommandWithUserCopy(false);
440435
}
441-
});
442-
}
436+
weak->_NotifyChanges(L"DisplayName");
437+
}
438+
});
443439
}
444440

445441
void CommandViewModel::_ReplaceCommandWithUserCopy(bool reinitialize)

0 commit comments

Comments
 (0)