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

with_del(cond.done()) doesn't always delete pairwise #370

Open
TroySigX opened this issue Jun 28, 2023 · 0 comments
Open

with_del(cond.done()) doesn't always delete pairwise #370

TroySigX opened this issue Jun 28, 2023 · 0 comments
Labels
bug Something isn't working pinned

Comments

@TroySigX
Copy link

TroySigX commented Jun 28, 2023

Description

For the rule similar to the sample config:

      npairs.add_rules({
        Rule("b%d%d%d%d%w$", "", "vim")
          :use_regex(true,"<tab>")
          :replace_endpair(function(opts)
                return
                    opts.prev_char
          end)
          :with_pair(cond.done())
          :with_del(cond.done()),
     })

After pressing b1234s<tab>, the end pair will be added, which is b1234sb1234s
Now, if I move the cursor to the opening pair b1234s|b1234s, where | is the current cursor, and press <BS>, it just removes the opening part, leaving the text after deletion to |b1234s

Mapping bug

1.If you report a bug about indent. Please remember that plugin doesn't do anything about indent.
It just trigger the indent of your vim config so if you have wrong indent config then it will do wrong indent.
You can check by select a block of code and press ==
2. provide result of command :verbose imap <cr>.

Steps to reproduce

No response

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'windwp/nvim-autopairs',
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('nvim-autopairs').setup()
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing nvim-autopairs and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@TroySigX TroySigX added the bug Something isn't working label Jun 28, 2023
@windwp windwp added the pinned label Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned
Projects
None yet
Development

No branches or pull requests

2 participants