Comments (1)
I have noticed the same issue in rust and csharp.
It may be related to the 'textobjects.select.include_surrounding_whitespace' option.
If it is set to true, I get the described behaviour.
If it is et to false, the function is selected correctly.
config (it's the sample config without comments)
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
},
selection_modes = {
['@parameter.outer'] = 'v',
['@function.outer'] = 'V',
['@class.outer'] = '<c-v>',
},
include_surrounding_whitespace = false, -- <-- set to TRUE and the selection breaks
},
}
:checkhealth nvim-treesitter
============================================================================== nvim-treesitter: require("nvim-treesitter.health").check()Installation ~
- OK
tree-sitter
found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar) - OK
node
found v21.6.1 (only needed for :TSInstallFromGrammar) - OK
git
executable found. - OK
cc
executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: cc (GCC) 13.2.1 20230801 - OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "x86_64",
release = "6.7.2-arch1-1",
sysname = "Linux",
version = "#1 SMP PREEMPT_DYNAMIC Fri, 26 Jan 2024 19:10:20 +0000"
} ~
Parser/Features H L F I J
- bash ✓ ✓ ✓ . ✓
- c ✓ ✓ ✓ ✓ ✓
- c_sharp ✓ ✓ ✓ . ✓
- csv ✓ . . . .
- graphql ✓ . . ✓ ✓
- html ✓ ✓ ✓ ✓ ✓
- hurl ✓ . ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- json ✓ ✓ ✓ ✓ .
- lua ✓ ✓ ✓ ✓ ✓
- luadoc ✓ . . . .
- luap ✓ . . . .
- markdown ✓ . ✓ ✓ ✓
- markdown_inline ✓ . . . ✓
- python ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- regex ✓ . . . .
- rust ✓ ✓ ✓ ✓ ✓
- sql ✓ . . ✓ ✓
- tsx ✓ ✓ ✓ ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc ✓ . . . ✓
- wgsl ✓ . ✓ ✓ .
- yaml ✓ ✓ ✓ ✓ ✓
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} ~
nvim --version
NVIM v0.9.5 Build type: Release LuaJIT 2.1.1702233742system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
from nvim-treesitter-textobjects.
Related Issues (20)
- error on perl files HOT 1
- Swap Keymaps Not Being Used in TypeScript, Javascript, or Ruby Buffers HOT 4
- Allow multiple queries for `select` to increase configurability
- Richer Nix queries
- after nvim-treesitter/nvim-treesitter#6024, `nvim-treesitter-textobject` started showing errors HOT 1
- Scope locals not correct for lua files
- The `move` function is very slow on some large cpp files HOT 2
- Add `set_jumps` option to `select` module
- Delete @function.outer deletes more than it should HOT 3
- Errors on Fennel files; need to update queries HOT 1
- nvim-treesitter.textobjects.repeatable_move is not found HOT 1
- Built in textobjects table is hard to read
- Assignment operator do not exist for c/cpp HOT 12
- Select Mode Keymaps appear broken HOT 2
- @inner.block @outer.block makes no sense in C I believe HOT 3
- Operator pending linewise mode override not observed for motions
- Extra text objects for latex: environments, maths, and sections HOT 1
- example "scope" ]s mapping seemingly does nothing
- Add `#make-range-between!`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-treesitter-textobjects.