name: Bug report
description: Report a problem with nvim-autopairs  
labels: [bug]
body:
  - type: markdown
    attributes:
      value: |
        Before reporting: search [existing issues](https://github.com/windwp/nvim-autopairs/issues) and make sure that both nvim-autopairs and its dependencies are updated to the latest version.
  - type: textarea
    attributes:
      label: "Description"
      description: "A short description of the problem you are reporting."
    validations:
      required: true
  - type: textarea
    attributes:
      label: "Mapping <cr> bug"
      description: "report a bug about mapping `<cr>` key and completion plugin"
      value: |
        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>`.
    validations:
      required: false
  - type: textarea
    attributes:
      label: "Steps to reproduce"
      description: "Steps to reproduce using the minimal config provided below."
      placeholder: |
        - It will beter if you can provide a video of gif
    validations:
      required: false
  - type: textarea
    attributes:
      label: "Minimal config"
      description: "Minimal(!) configuration necessary to reproduce the issue. Save this as `minimal.lua`. If _absolutely_ necessary, add plugins and config options from your `init.lua` at the indicated lines."
      render: Lua
      value: |
        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()]]
    validations:
      required: true
