nvim-treesitter / nvim-treesitter/nvim-treesitter-textobjects
Swap doesn't work with commented code
Nobody has claimed this yet.
- Dominant language
- Tree-sitter Query
- Stars
- 2.8k
- Forks
- 271
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 1
Description
Describe the bug
Swap doesn't work with commented code
To Reproduce
Download minimal init.lua: https://gist.github.com/kuator/10f7898c6e15c1c5edf54aba6eb9bd44.
Run:
$ mkdir ~/.config/repro
$ cd ~/.config/repro
$ wget https://gist.githubusercontent.com/kuator/10f7898c6e15c1c5edf54aba6eb9bd44/raw/fbf8f79460d870da11d2ea53b1050e07f695f476/init.lua
$ NVIM_APPNAME=repro nvim init.lua
Jump to the test_code, specifically line 118, try to do a swap, it does nothing, swap works on main though.
Expected behavior
Swap happens
Output of nvim --version
NVIM v0.12.0-dev-347+gbee45fc0e7
Build type: RelWithDebInfo
LuaJIT 2.1.1744317938
Run "nvim -V1 -v" for more info
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the linked minimal init.lua using the commands in the report, then inspect the swap behavior around line 118 and compare it with main. Done means swap works when the relevant code includes comments, while the existing non-commented behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100