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

Highlight the line containing the todo #722

Closed ymyke closed 1 year ago

ymyke commented 1 year ago

From the README:

"Clicking a TODO within the tree will open the file and put the cursor on the line containing the TODO."

Since I don't see the cursor as long as I don't bring the focus to the editor window, it's often hard to find the todo on the page.

Is there a setting to highlight the line with the todo? Similar to what the "Search: Find in Files" does?

If not, would that be a worthwhile feature maybe?

Thanks for the great extension!

yw662 commented 1 year ago

use todo-tree.highlights.customHighlight.

ymyke commented 1 year ago

I'm using that for permanent highlights, yes.

What I'm looking for is a temporary highlight (i.e., quickly flashing the line with the todo) to draw attention to it.

Gruntfuggly commented 1 year ago

It sounds possible, but it might be a bit tricky to do something with the current highlight. I could perhaps flash a highlight on the entire line - like find in files does (as you said).

I was wondering why this isn't an issue for me, but I realised it's because vscode highlights the current line. Does yours not do this? I can't find a setting to turn it off.

ymyke commented 1 year ago

Interesting. My vscode doesn't flash the line. Tried different themes too. – It does flash/highlight when clicking on a "Find in Files" result though. 🤔

Gruntfuggly commented 1 year ago

sorry - it doesn't flash the line, but it does indicate the current line in the editor with a line above and below:

image

ymyke commented 1 year ago

I see what you mean. I have dialed that down via "editor.renderLineHighlight": "gutter", so in my case it is very subtle to see which line is highlighted. For me, it would be great to have a quick flash upon clicking a todo. But if I'm the only one, it's maybe not worth the effort.

Gruntfuggly commented 1 year ago

I think it should be fairly easy to do - should even be able to use the same colour as the find in files flash. It will make it more consistent with VSCode too. 8-)

Gruntfuggly commented 1 year ago

This will be in the next release.

ymyke commented 1 year ago

Fantastic, thank you!

ymyke commented 1 year ago

Works like a charm and improves UX a lot, thanks! 🙏