Add a new :toggle-folder command that toggles the expand/collapse state
of a folder in the directory tree view. This provides a convenient
single command alternative to using :expand-folder and :collapse-folder
separately.
The toggle behavior is consistent with existing commands:
- For folders with children: toggles the folder's own hidden state
- For leaf nodes: toggles the parent folder (same as collapse)
- For root nodes without children: no-op (nothing to toggle)
Also add comprehensive unit tests for collapse, expand, and toggle
folder operations covering top-level, nested, and deeply nested folders.
Changelog-added: `:toggle-folder` command to toggle directory tree
expand/collapse state.
Signed-off-by: Arjuna Del Toso <arjuna@deltoso.net>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>