nvim-treesitter / nvim-treesitter-textobjects

Apache License 2.0
2.18k stars 195 forks source link

seems `vif vaf` it's not work? #279

Closed NEX-S closed 2 years ago

NEX-S commented 2 years ago

Describe the bug seeme vif vaf it's not work

To Reproduce vif vaf vic vac is not work, instead it will add a blank line in function

Expected behavior vif... work normal

Output of :checkhealth nvim-treesitter

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.6 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v14.20.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (GCC) 12.1.1 20220730
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - http           ✓ . . . ✓
  - java           ✓ ✓ . ✓ ✓
  - vim            ✓ ✓ ✓ . ✓
  - c              ✓ ✓ ✓ ✓ ✓
  - json           ✓ ✓ ✓ ✓ .
  - go             ✓ ✓ ✓ ✓ ✓
  - lua            ✓ ✓ ✓ ✓ ✓
  - python         ✓ ✓ ✓ ✓ ✓
  - html           ✓ ✓ ✓ ✓ ✓
  - php            ✓ ✓ ✓ ✓ ✓
  - markdown       ✓ . ✓ . ✓

  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

NVIM v0.8.0-dev-1013-g1ffd527c83
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions     -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security     -fstack-clash-protection -fcf-protection -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/nex/.cache/yay/neovim-git/src/build/cmake.config -I/home/nex/.cache/yay/neovim-git/src/neovim-git/src -I/usr/include -I/home/nex/.cache/yay/neovim-git/src/build/src/nvim/auto -I/home/nex/.cache/yay/neovim-git/src/build/include
Compiled by nex@UNEXPECTED

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Additional context config

    textobjects = {
        select = {
            enable = true,
            -- Automatically jump forward to textobj, similar to targets.vim
            lookahead = true,
            keymaps = {
                -- You can use the capture groups defined in textobjects.scm
                ["af"] = "@function.outer",
                ["if"] = "@function.inner",
                ["ac"] = "@class.outer",
                ["ic"] = "@class.inner",
            },
        },
        move = {
            enable = true,
            set_jumps = true, -- whether to set jumps in the jumplist
            goto_next_start = {
                ["]m"] = "@function.outer",
                ["]]"] = "@class.outer",
            },
            goto_next_end = {
                ["]M"] = "@function.outer",
                ["]["] = "@class.outer",
            },
            goto_previous_start = {
                ["[m"] = "@function.outer",
                ["[["] = "@class.outer",
            },
            goto_previous_end = {
                ["[M"] = "@function.outer",
                ["[]"] = "@class.outer",
            },
        },
    },

https://user-images.githubusercontent.com/97107165/188244644-942ac0a7-cc14-41b4-bb79-88a9e2079930.mp4

theHamsta commented 2 years ago

Wasn't that fixed with https://github.com/nvim-treesitter/nvim-treesitter-textobjects/pull/272?

NEX-S commented 2 years ago

seems still here

NEX-S commented 2 years ago

https://user-images.githubusercontent.com/97107165/188248572-ae81fb2d-fb6c-49e9-af45-e60d3ad5e18c.mp4

jamesb6626 commented 2 years ago

I just reported the same in #277, should I close and copy that info here? Bisect brought me to ce24406 in my case I think (though I haven't played with the old version for very long).

theHamsta commented 2 years ago

but does https://github.com/nvim-treesitter/nvim-treesitter-textobjects/pull/280 solve the issue?

NEX-S commented 2 years ago

No, seems issue is still there :(

jamesb6626 commented 2 years ago

For me, the PR (now current master) seems to fix it, awesome. I'll close my duplicate.