Fix shortcut collapse after edit

This commit is contained in:
Ger Hean 2022-01-04 13:26:39 +08:00
parent df1724470d
commit 472c6cbfdc

View file

@ -327,13 +327,15 @@ void EditorSettingsDialog::_update_shortcuts() {
// Try go down tree
TreeItem *ti_next = ti->get_first_child();
// Try go across tree
// Try go to the next node via in-order traversal
if (!ti_next) {
ti_next = ti->get_next();
}
// Try go up tree, to next node
if (!ti_next) {
ti_next = ti->get_parent()->get_next();
ti_next = ti;
while (ti_next && !ti_next->get_next()) {
ti_next = ti_next->get_parent();
}
if (ti_next) {
ti_next = ti_next->get_next();
}
}
ti = ti_next;