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

Disabling single-quote pairing affects double-quote pairing as well #433

Closed
YohananDiamond opened this issue Feb 21, 2024 · 2 comments
Closed
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@YohananDiamond
Copy link

YohananDiamond commented Feb 21, 2024

Description

After pressing single-quote on a line, it will not pair (as expected), but double-quotes placed on the right of it won't pair anymore.

Mapping bug

No response

Steps to reproduce

  • Open neovim (nvim -u minimal.lua)
  • Wait for the Ready! message to appear
  • :e test.lisp
  • Go into insert mode and type "foo. It should be pairing correctly (the result is "foo")
  • Type <Esc>A 'foo. It should not pair (result "foo" 'foo)
  • Type <Esc>A "baz. It should pair, yet it won't (result "foo" 'foo "baz)
  • Type <Esc>0Ea "bar. It should pair, and it works (result "foo" "bar" 'foo "baz)

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',
            },
        },
        config = {
            package_root = package_root,
            compile_path = install_path .. '/plugin/packer_compiled.lua',
            display = { non_interactive = true },
        },
    }
end

_G.load_config = function()
    local autopairs = require("nvim-autopairs")
    autopairs.setup()

    local sq_rule = autopairs.get_rules("'")[1]
    sq_rule.not_filetypes = {"lisp"}
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()]]
@YohananDiamond YohananDiamond added the bug Something isn't working label Feb 21, 2024
Copy link

stale bot commented Apr 21, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 21, 2024
@YohananDiamond
Copy link
Author

(Should I... try to un-stale it?)

@stale stale bot closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant