nvim-treesitter / nvim-treesitter-textobjects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Visual mode commands are broken

michelesr opened this issue · comments

Since #342 was merged, if you use e.g. vaf where af is mapped as:

x  af          *@<Cmd>lua require'nvim-treesitter.textobjects.select'.select_textobject('@function.outer', 'x')<CR>
                 Select textobject @function.outer

The text is not selected correctly, instead, a new line gets added to the text. See attached screenshots.

Cursor position

screenshot-2022-12-22-14:17:56

Pressing vaf after #342

screenshot-2022-12-22-14:18:02

Pressing vaf before #342
screenshot-2022-12-22-14:18:28

Output of checkhealth:

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v19.2.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.2.0
  - 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.0.12-arch1-1",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Thu, 08 Dec 2022 11:03:38 +0000"
}

## Parser/Features         H L F I J
  - python              ✓ ✓ ✓ ✓ ✓
  - json                ✓ ✓ ✓ ✓ .
  - bash                ✓ ✓ ✓ . ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - c                   ✓ ✓ ✓ ✓ ✓
  - go                  ✓ ✓ ✓ ✓ ✓
  - markdown            ✓ . ✓ . ✓
  - ruby                ✓ ✓ ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - rust                ✓ ✓ ✓ ✓ ✓
  - query               ✓ ✓ ✓ ✓ ✓
  - 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.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

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

Looks like we should revert. I also realized that the plugin was no longer working as expected.