Skip to content

Commit

Permalink
fix(nix): proper multi-line string rule (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribru17 committed Apr 6, 2024
1 parent 5793a8c commit 4f41e59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/nvim-autopairs/rules/basic.lua
Expand Up @@ -44,7 +44,7 @@ local function setup(opt)
Rule("```.*$", "```", { "markdown", "vimwiki", "rmarkdown", "rmd", "pandoc" }):only_cr():use_regex(true),
Rule('"""', '"""', { "python", "elixir", "julia", "kotlin" }):with_pair(cond.not_before_char('"', 3)),
Rule("'''", "'''", { "python" }):with_pair(cond.not_before_char('"', 3)),
quote("'", "'", "-rust")
quote("'", "'", { "-rust", "-nix" })
:with_pair(function(opts)
-- python literals string
local str = utils.text_sub_char(opts.line, opts.col - 1, 1)
Expand All @@ -54,6 +54,7 @@ local function setup(opt)
end)
:with_pair(cond.not_before_regex("%w")),
quote("'", "'", "rust"):with_pair(cond.not_before_regex("[%w<&]")):with_pair(cond.not_after_text(">")),
Rule("''", "''", 'nix'):with_move(cond.after_text("'")),
quote("`", "`"),
quote('"', '"', "-vim"),
quote('"', '"', "vim"):with_pair(cond.not_before_regex("^%s*$", -1)),
Expand Down

0 comments on commit 4f41e59

Please sign in to comment.