Skip to content

Unintended wrapping occurring in special case #521

@shyun3

Description

@shyun3

Description

Begin with the following line:

["'"] = { pattern = |},

where | is the cursor.

Type ':

["'"] = { pattern = '|'},

Type [:

["'"] = { pattern = '[|']},

Note how the ] has been placed after the closing '. I expected the result to be '[]'.

This can be prevented by disabling enable_afterquote, but I'd prefer to keep it on as it is useful.

Mapping bug

N/A

Steps to reproduce

See description.

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()]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpinned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions