-
Notifications
You must be signed in to change notification settings - Fork 261
Description
Contributing guidelines
- I have read CONTRIBUTING.md
- I have read CODE_OF_CONDUCT.md
- I have updated 'mini.nvim' to latest version of the
main
branch
Module(s)
mini.ai
Neovim version
0.11.x
Description
Some builtin Neovim operators (and some custom operators) do perform an action when executed with a opertor-pending mode keymap that doesn't move the cursor nor visually selects any region. d
doesn't delete anything, but empties the content of the "
register (just like y
). c
starts insert mode in current location (just like if i
was pressed). Linewise operators like >
still indent the whole line, etc.
When mini.ai
can't find a textobject, it behaves in the aforementioned way.
Reproduction
-
Create separate 'nvim-repro' config directory:
- '~/.config/nvim-repro/' on Unix
- '~/AppData/Local/nvim-repro/' on Windows
-
Inside 'nvim-repro' directory create a file named 'init.lua'.
Populate it with the following content:-- Clone latest 'mini.nvim' (requires Git CLI installed) vim.cmd('echo "Installing `mini.nvim`" | redraw') local mini_path = vim.fn.stdpath('data') .. '/site/pack/deps/start/mini.nvim' local clone_cmd = { 'git', 'clone', '--depth=1', 'https://github.com/echasnovski/mini.nvim', mini_path } vim.fn.system(clone_cmd) vim.cmd('echo "`mini.nvim` is installed" | redraw') -- Make sure 'mini.nvim' is available vim.cmd('packadd mini.nvim') require('mini.deps').setup() -- Add extra setup steps needed to reproduce the behavior -- Use `MiniDeps.add('user/repo')` to install another plugin from GitHub
-
Run
NVIM_APPNAME=nvim-repro nvim
(i.e. executenvim
withNVIM_APPNAME
environment variable set to "nvim-repro"). Wait for all dependencies to install. -
i"foo"<esc>
to write"foo"
in the current buffer -
yy
and thenp
to copy"foo"
and paste it -
yi'
. An error message will be displayed explaining that no textobjecti'
could be found -
p
to paste. Nothing will be pasted
Note. the same can be tested with the other operators mentioned above, not only y
.