about summary refs log tree commit diff
path: root/fnl/nvrc/macro
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-02-27 00:32:05 +0900
committersefidel <contact@sefidel.net>2022-02-27 00:32:05 +0900
commit36f342ad71fdfdb8444ae9723ed4e383d57d82fb (patch)
tree5aa496ad66a9dd972c9d793ac0afcb0d9ccbdc7d /fnl/nvrc/macro
parent06616c4262c5587685283745a1e3f33a043279c4 (diff)
downloadnvimrc-36f342ad71fdfdb8444ae9723ed4e383d57d82fb.tar.gz
nvimrc-36f342ad71fdfdb8444ae9723ed4e383d57d82fb.zip
feat(macro)!: use macro for highlighting
Diffstat (limited to 'fnl/nvrc/macro')
-rw-r--r--fnl/nvrc/macro/color.fnl11
1 files changed, 7 insertions, 4 deletions
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!}