NikitaIvanovV / ictree

Like tree but interactive
https://nikitaivanovv.github.io/ictree/
GNU General Public License v3.0
147 stars 7 forks source link

Left / Right arrow keys to fold #13

Closed dufferzafar closed 2 years ago

dufferzafar commented 2 years ago

Currently, up/down arrow keys can be used to traverse the tree, while enter folds / unfolds.

In other tree like controls (usually on GUIs), left / right arrow keys are used to unfold / fold an item

NikitaIvanovV commented 2 years ago

If what you're suggesting is more conventional, ictree should probably have those controls. However, right now left and arrow keys can be used if the text doesn't fit screen width (by pressing those keys you scroll horizontally).

NikitaIvanovV commented 2 years ago

Resolved in 67c72d4f7562ffed1f8a2227683f5f6ac74ffbe4

I forgot that one can also use h and l to scroll horizontally, so it's not a probem to use arrow keys for different action.

Thanks for the suggestion!

dufferzafar commented 2 years ago

Sorry, perhaps I should've clarified the behaviour more.

In tree views, say for eg in VS Code's left sidebar tree view & Qt GUI tree views, pressing Left on an item would:

Similarly, Right would unfold if an item if it is folded or just go to it's first child.

This allows us to quickly go up / down the tree.

NikitaIvanovV commented 2 years ago

Added proper behavior for Right arrow as well: 69e142ed32c414b17ce049b214b997afd8df302b