-
Notifications
You must be signed in to change notification settings - Fork 200
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
Delete @function.outer deletes more than it should #575
Comments
The problem is, if you set |
A possible solution is to change the |
Another option would be to set the For reference |def ff2(b: int):
b = 2
pass|
|def ff2(b: int):
b = 2
pass
|pass |
Changing def fun1(self):
pass
def fun2(self):
pass becomes: # def fun1(self):
# pass
# def fun2(self):
pass |
It is also better to yank/delete a method linewise to move it around. Yanking/deleteting it charwise results in weird indentation issues if you're not accounting for that. I have gotten it to work by adding a check if the selection mode is linewise to update the column end position to 0 before the update.selection call. Realize it's not the best solution but it seems to work well. I can get a pr out for this if the solution seems decent. |
Describe the bug
After configuring
daf
to delete outer function lines, more than the function is deleted.To Reproduce
Given LazyVim and the following snippet configuration
And the following sample code
if you go online
:18
and pressdaf
, you will deleteExpected behavior
I'm expecting to delete exactly
the
pass
on line 22 should still be there afterdap
.Output of
:checkhealth nvim-treesitter
──────────────────────────────────────────────────────────────────────────────
nvim-treesitter: require("nvim-treesitter.health").check()
Installation
Version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
OS Info:
{
machine = "x86_64",
release = "5.4.0-132-generic",
sysname = "Linux",
version = "#148-Ubuntu SMP Mon Oct 17 16:02:06 UTC 2022"
}
Parser/Features H L F I J
- bash ✓ ✓ ✓ . ✓
- c ✓ ✓ ✓ ✓ ✓
- diff ✓ . . . .
- html ✓ ✓ ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- jsdoc ✓ . . . .
- json ✓ ✓ ✓ ✓ .
- jsonc ✓ ✓ ✓ ✓ ✓
- lua ✓ ✓ ✓ ✓ ✓
- luadoc ✓ . . . .
- luap ✓ . . . .
- markdown ✓ . ✓ ✓ ✓
- markdown_inline ✓ . . . ✓
- python ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- regex ✓ . . . .
- toml ✓ ✓ ✓ ✓ ✓
- tsx ✓ ✓ ✓ ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc ✓ . . . ✓
- yaml ✓ ✓ ✓ ✓ ✓
Output of
nvim --version
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: