diff --git a/lua/dumb-autopairs/init.lua b/lua/dumb-autopairs/init.lua index 340e4a5..c028696 100644 --- a/lua/dumb-autopairs/init.lua +++ b/lua/dumb-autopairs/init.lua @@ -67,7 +67,7 @@ end --- @param s string --- @return boolean local function has_operator_suffix(s) - return hassuffix(s, { "=", ":" }) + return hassuffix(s, { "=", ":", "," }) end local M = {} diff --git a/tests/quotes_spec.lua b/tests/quotes_spec.lua index 7b8ccf1..8a67754 100644 --- a/tests/quotes_spec.lua +++ b/tests/quotes_spec.lua @@ -51,9 +51,15 @@ local data = { }, { name = "pair when operator on left", - before = [[=|]], + before = [[= |]], feed = [[a"]], - after = { [[="|"]] }, + after = { [[= "|"]] }, + }, + { + name = "pair when comma on left", + before = [[, |]], + feed = [[a"]], + after = { [[, "|"]] }, }, }