Gruntfuggly / todo-tree

Use ripgrep to find TODO tags and display the results in a tree view
Other
1.4k stars 135 forks source link

Navigate side bar list with up/down arrows #730

Closed UCSIG closed 1 year ago

UCSIG commented 1 year ago

Hi,

I really like this extension and use it in all my projects. However, I would find it very useful to be able to navigate the list of all TODOs, FIXMEs, etc. in the side bar with the up and down arrows of the keyboard. Currently when clicking on an item in the status bar list, the line containing the TODO is centered and the cursor is moved to that location. One possibility could be to add an option to not move the focus to the editor, but keep the focus in the side bar list. The line containing the TODO could then be highlighted and centered when it is selected in the list. Upon clicking the up/down arrow the next item is selected and centered in the editor, etc.. This behaviour is implemented for example in the search/find in all files feature of VS Code. Here, the results list in the side bar can be navigated with the keyboard arrows, the selected list item is highlighted in the editor and centered. Hopefully I've explained it clearly, that would make the extension even more awesome!

Gruntfuggly commented 1 year ago

I'll see what I can do - there are already options for focusing when selecting from the tree, so a 'none' might make sense for this.

In the meantime, a partial work around is you can bind keys to Todo Tree: Go To Next and Todo Tree: Go To Previous. It will only work in the current file though.

Gruntfuggly commented 1 year ago

Will be in the next release.

UCSIG commented 1 year ago

Awesome, thank you very much!

Gruntfuggly commented 1 year ago

Should be fixed in the current version - see the new setting for todo-tree.general.revealBehaviour (leave focus in tree).