mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
feat(mini.pairs): enable mini.pairs in the cmdline
This commit is contained in:
parent
71390adcbe
commit
2daca4b510
2 changed files with 4 additions and 0 deletions
|
@ -142,6 +142,7 @@ return {
|
|||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
-- skip autopair when next character is one of these
|
||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
-- skip autopair when the cursor is inside these treesitter nodes
|
||||
|
|
|
@ -115,6 +115,9 @@ function M.pairs(opts)
|
|||
pairs.setup(opts)
|
||||
local open = pairs.open
|
||||
pairs.open = function(pair, neigh_pattern)
|
||||
if vim.fn.getcmdline() ~= "" then
|
||||
return open(pair, neigh_pattern)
|
||||
end
|
||||
local o, c = pair:sub(1, 1), pair:sub(2, 2)
|
||||
local line = vim.api.nvim_get_current_line()
|
||||
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue