mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-08-16 02:30:48 +03:00
fix: python multiple quote
This commit is contained in:
parent
6ba1868a66
commit
bd1bcb4dde
@ -36,25 +36,30 @@ local function setup(opt)
|
||||
Rule("```.*$", "```", { 'markdown', 'vimwiki', 'rmarkdown', 'rmd', 'pandoc' })
|
||||
:only_cr()
|
||||
:use_regex(true),
|
||||
Rule('"""', '"""', { 'python', 'elixir', 'julia', 'kotlin' }),
|
||||
Rule("'''", "'''", { 'python' }),
|
||||
Rule('"""', '"""', { 'python', 'elixir', 'julia', 'kotlin' })
|
||||
:with_pair(cond.not_before_char('"', 3)),
|
||||
Rule("'''", "'''", { 'python' })
|
||||
:with_pair(cond.not_before_char('"', 3)),
|
||||
basic("'", "'", '-rust')
|
||||
:with_pair(cond.not_before_regex("%w")),
|
||||
basic("'", "'", 'rust')
|
||||
:with_pair(cond.not_before_regex("[%w<&]"))
|
||||
:with_pair(cond.not_after_text(">")),
|
||||
basic("`", "`"),
|
||||
basic('"', '"','-vim'),
|
||||
basic('"', '"','vim')
|
||||
basic('"', '"', '-vim'),
|
||||
basic('"', '"', 'vim')
|
||||
:with_pair(cond.not_before_regex("^%s*$", -1)),
|
||||
bracket("(", ")"),
|
||||
bracket("[", "]"),
|
||||
bracket("{", "}"),
|
||||
Rule(">[%w%s]*$", "^%s*</",
|
||||
{ 'html', 'typescript', 'typescriptreact', 'javascript' , 'javascriptreact', 'svelte', 'vue', 'xml', 'rescript'})
|
||||
{ 'html', 'typescript', 'typescriptreact', 'javascript', 'javascriptreact', 'svelte', 'vue', 'xml',
|
||||
'rescript' })
|
||||
:only_cr()
|
||||
:use_regex(true)
|
||||
}
|
||||
return rules
|
||||
end
|
||||
|
||||
return { setup = setup }
|
||||
|
||||
|
@ -50,6 +50,13 @@ local data = {
|
||||
before = [[""| ]],
|
||||
after = [["""|""" ]]
|
||||
},
|
||||
{
|
||||
name = "don't repeat python quote" ,
|
||||
filetype = "python",
|
||||
key = [["]],
|
||||
before = [[a"""|""" ]],
|
||||
after = [[a""""|"" ]]
|
||||
},
|
||||
|
||||
{
|
||||
name = "add markdown quote" ,
|
||||
|
Loading…
Reference in New Issue
Block a user