-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Next/Previous Todo Comment jumps outside of comments #301
Labels
bug
Something isn't working
Comments
geoffreylefebvre
added a commit
to geoffreylefebvre/todo-comments.nvim
that referenced
this issue
Jul 19, 2024
geoffreylefebvre
added a commit
to geoffreylefebvre/todo-comments.nvim
that referenced
this issue
Jul 23, 2024
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
bump |
geoffreylefebvre
added a commit
to geoffreylefebvre/todo-comments.nvim
that referenced
this issue
Sep 17, 2024
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
bump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
MacOS 12.7.5
Describe the bug
When navigating a file containing KEYWORDS outside of comments, next/prev todo comments jumps to these even if the buffer has treesitter support and todo-comments is configured with comments_only. This issue happens with Go code which contains context.TODO(), and todo-comments using a pattern that does not require a colon.
I think the problem is that is_comment() in highlight.lua returns true or nil, and the caller in jump.lua explicitly checks for false.
A solution would be for is_comment to return false when the buffer has treesitter support and the match is outside of a comment, or for the caller to test against ~= true instead of == false.
Steps To Reproduce
Expected Behavior
next/prev todo comments should not jump to context.TODO() (or any of the KEYWORDS) outside comments.
Repro
The text was updated successfully, but these errors were encountered: