nvim: improve /* */ comment paring

This commit is contained in:
Primrose 2025-08-21 08:30:09 +02:00
parent 1e1a6b395f
commit 58dde3289e
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -54,12 +54,9 @@ pair_with_insertion("[", " ", "]", { "typst", "python", "haskell", "nix", "sh" }
pair_with_insertion("{", " ", "}", nil)
npairs.add_rules {
Rule("*", "*/", { "typst", "go", "rust", "scss" })
:with_pair(function(opts) return "/" == opts.line:sub(opts.col - 1, opts.col) end)
:with_del(cond.none()) -- this is only a partial rule, deletion doesn't make sense
:with_move(cond.none()), -- allow java doc
Rule("/*", "*/", { "typst", "go", "rust", "scss", "nix" }):with_del(cond.done()):with_move(cond.none()), -- allow java doc
}
pair_with_insertion("/*", " ", "*/", { "typst", "go", "java", "rust", "scss" })
pair_with_insertion("/*", " ", "*/", { "typst", "go", "java", "rust", "scss", "nix" })
pair_with_insertion("{", "#", "}", { "html", "htmldjango" })
pair_with_insertion("{#", " ", "#}", { "html", "htmldjango" })