From 36f342ad71fdfdb8444ae9723ed4e383d57d82fb Mon Sep 17 00:00:00 2001 From: sefidel Date: Sun, 27 Feb 2022 00:32:05 +0900 Subject: feat(macro)!: use macro for highlighting --- fnl/nvrc/macro/color.fnl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'fnl/nvrc/macro') diff --git a/fnl/nvrc/macro/color.fnl b/fnl/nvrc/macro/color.fnl index 9636956..d481fc9 100644 --- a/fnl/nvrc/macro/color.fnl +++ b/fnl/nvrc/macro/color.fnl @@ -1,9 +1,12 @@ (fn tbl? [x] (= :table (type x))) -(fn highlight [group-arg colset] +(fn highlight! [group colset] "Add a highlighting group." - (each [_ group (ipairs (if (tbl? group-arg) group-arg [group-arg]))] - (vim.api.nvim_set_hl 0 group colset))) + `(vim.api.nvim_set_hl 0 ,group ,colset)) -{: highlight} +(fn link! [group link] + "Link a highlighting group." + (highlight! group {:link link})) + +{: highlight! : link!} -- cgit 1.4.1