-
Notifications
You must be signed in to change notification settings - Fork 195
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
example "scope" ]s mapping seemingly does nothing #604
Comments
Try this ["]s"] = { query = "@local.scope", query_group = "locals", desc = "Next scope" }, |
That actually does something, which is much better than before! It's not exactly what I want, for example with this C code I first move to the first letter of the int c = 3;
if (ptr == MAP_FAILED) {
/* 1 2 */
perror("mmap");
return 0;
} But it's already a lot better than before. Thanks. |
This happens because for statement, if statement, while statement, function definition, etc are also defined to make their own scope in https://github.com/nvim-treesitter/nvim-treesitter/blob/4770d9a1a77b0cc2b723c646c3dbe43a9133e5db/queries/c/locals.scm#L58-L67 The work around is to copy that file to |
So the query names in |
Describe the bug
Simply put, the ]s, [s, ]S, [S mappings do nothing for me (no movement), when attempting to navigate around simple C and Go files (haven't tried others yet). Mappings like ]m, [m, ]M, [M do work.
I'm not sure if this problem is PEBKAC or not, but having seen
locals.scm
for Go/C/..., I suspect it isn't. The README gives this example:But there is no movement (see below). I've verified that
nmap ]s
shows me an anonymous Lua function is bound.To Reproduce
Expected behavior
I expected some movement to happen.v
Output of
:checkhealth nvim-treesitter
Installation ~
tree-sitter
executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)node
executable not found (only needed for :TSInstallFromGrammar, not required for :TSInstall)git
executable found.cc
executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }Version: cc (Debian 13.2.0-10) 13.2.0
OS Info:
{
machine = "x86_64",
release = "6.6.13-amd64",
sysname = "Linux",
version = "#1 SMP PREEMPT_DYNAMIC Debian 6.6.13"
} ~
Parser/Features H L F I J
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang} ~
Output of
nvim --version
The text was updated successfully, but these errors were encountered: