Skip to content
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

Installing this plugin cause misbehavior on the native "f" and "t" motions. #381

Closed
Aex12 opened this issue Feb 6, 2023 · 4 comments · Fixed by #382
Closed

Installing this plugin cause misbehavior on the native "f" and "t" motions. #381

Aex12 opened this issue Feb 6, 2023 · 4 comments · Fixed by #382
Labels
bug Something isn't working

Comments

@Aex12
Copy link

Aex12 commented Feb 6, 2023

Describe the bug
Just by installing this plugin (it doesnt matter if you configure it or not, it will cause the bug anyway), it will make the native vim motions for "f" and "t" misbehave, leaving you just one character before where you should be.

To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin
  2. Open a new file and write 'myFunction (a: number, b: string)'
  3. Position your cursor on the first parameter 'a'.
  4. Type ct, this should remove the param completely and leave you in insert mode with a , at the right of your cursor, but instead you have 'r,' at your right.
  5. If you type cf, you should be left without any comma at your right, just an space, but instead you get the comma at your right.

Output of :checkhealth nvim-treesitter

## Installation - OK: `tree-sitter` found 0.20.7 (b268e412ad4848380166af153300464e5a1cf83f) (parser generator, only needed for :TSInstallFromGrammar) - OK: `node` found v18.13.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.1 20221121 (Red Hat 12.2.1-4) - 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.1.8-200.fc37.x86_64",
sysname = "Linux",
version = "#1 SMP PREEMPT_DYNAMIC Tue Jan 24 20:32:16 UTC 2023"
}

Parser/Features H L F I J

- dockerfile          ✓ . . . ✓    
- gitcommit           ✓ . . . ✓    
- gitignore           ✓ . . . .    
- bash                ✓ ✓ ✓ . ✓    
- perl                ✓ . ✓ . ✓    
- python              ✓ ✓ ✓ ✓ ✓    
- yaml                ✓ ✓ ✓ ✓ ✓    
- jsdoc               ✓ . . . .    
- javascript          ✓ ✓ ✓ ✓ ✓    
- tsx                 ✓ ✓ ✓ ✓ ✓    
- css                 ✓ . ✓ ✓ ✓    
- prisma              ✓ . . . .    
- html                ✓ ✓ ✓ ✓ ✓    
- markdown_inline     ✓ . . . ✓    
- dot                 ✓ . . . ✓    
- rust                ✓ ✓ ✓ ✓ ✓    
- diff                ✓ . . . .    
- go                  ✓ ✓ ✓ ✓ ✓    
- json                ✓ ✓ ✓ ✓ .    
- lua                 ✓ ✓ ✓ ✓ ✓    
- c                   ✓ ✓ ✓ ✓ ✓    
- vim                 ✓ ✓ ✓ . ✓    
- typescript          ✓ ✓ ✓ ✓ ✓    
- regex               ✓ . . . .    
- sql                 ✓ . . . ✓    
- php                 ✓ ✓ ✓ ✓ ✓    
- markdown            ✓ . ✓ . ✓    
- help                ✓ . . . ✓    
- smali               ✓ . . . ✓    
                               
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.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -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/builddir/build/BUILD/neovim-0.8.2/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.8.2/src -I/usr/include -I/usr/include/luajit-2.1 -I/builddir/build/BUILD/neovim-0.8.2/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.8.2/redhat-linux-build/include
Compiled by mockbuild@koji

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
Add any other context about the problem here.

@Aex12 Aex12 added the bug Something isn't working label Feb 6, 2023
@kiyoon
Copy link
Collaborator

kiyoon commented Feb 6, 2023

Can't reproduce. Can you share a minimal config that reproduces the problem?

local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system { "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "nvim-treesitter/nvim-treesitter",
  "nvim-treesitter/nvim-treesitter-textobjects",
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

From this config I don't have any problem with them.

It might be another plugin that remaps the keys when this plugin is installed. Can you check :map f and :map t if they're mapped to something?

@Aex12
Copy link
Author

Aex12 commented Feb 6, 2023

@kiyoon Hi! Thanks for the quick reply.

I just changed from packer.nvim to lazy.nvim and the problem seems to be solved. Not sure why it didn't work as expected with packer.

@Aex12 Aex12 closed this as completed Feb 6, 2023
@Aex12
Copy link
Author

Aex12 commented Feb 6, 2023

Okey, after a bit of playing, seems like the issue is caused when using the 'nvim-treesitter.textobjects.repeatable_move' extension with the builtIn 'f', 'F', 't', 'T' binded to their respective mappings

@Aex12 Aex12 reopened this Feb 6, 2023
@kiyoon
Copy link
Collaborator

kiyoon commented Feb 7, 2023

You're right, thanks for reporting the issue. I'll work on this soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants