'I' for collapsing children

This commit is contained in:
nadrad 2022-09-13 11:45:03 +02:00
parent 6aaac9200d
commit 48e7932d4e
2 changed files with 16 additions and 0 deletions

15
h-m-m
View file

@ -2038,6 +2038,20 @@ function collapse_other_branches(&$mm)
display($mm);
}
function collapse_inner(&$mm)
{
foreach ($mm['nodes'][ $mm['active_node'] ]['children'] as $cid)
$mm['nodes'][$cid]['collapsed'] = true;
$mm['nodes'][ $mm['active_node'] ]['collapsed'] = false;
build_map($mm);
center_active_node($mm);
display($mm);
}
function find_branch(&$mm, $cid)
{
if ($mm['nodes'][$cid]['parent'] == $mm['root'])
@ -2332,6 +2346,7 @@ function monitor_key_presses(&$mm)
case 'h': change_active_node($mm, move_left); break;
case 'i': collapse_other_branches($mm); break;
case 'I': collapse_inner($mm); break;
case 'j': change_active_node($mm, move_down); break;
case 'J': move_active_node_down($mm); break;

View file

@ -52,6 +52,7 @@ Collapsing and expanding:
* `f` - focuses by collapsing all, but the ancestors and descendants of the active node
* `F` - locks focus as the active node changes (try it with the center lock)
* `i` - collapses all the first level items except for the one that contains the active node
* `I` - collapses the children of the active node
Search: