diff options
author | Akianonymus <anonymus.aki@gmail.com> | 2022-08-28 12:30:35 +0530 |
---|---|---|
committer | Akianonymus <anonymus.aki@gmail.com> | 2022-09-03 17:24:25 +0530 |
commit | 28b41de2f491ef598197823c04fc7e86ae76a625 (patch) | |
tree | b480ea1c0f58e4802e92a6de9baf26f27b6e855d /test/print-trie.lua | |
parent | feat: Incremental highlight loading (diff) |
fragment | Implement better autocmd management | refactor
add a all_buffers option - colorizer will activate on all buffers, empty or not, still respect filetypes option
handle errors when detach is called multiple times from the same buffer
use bufdelete and bufdelete to remove the autocmds
use a more efficient compile parse_fn function
use custom ldoc template to generate vim help
Diffstat (limited to 'test/print-trie.lua')
-rw-r--r-- | test/print-trie.lua | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/test/print-trie.lua b/test/print-trie.lua index 7575b5c..90017ad 100644 --- a/test/print-trie.lua +++ b/test/print-trie.lua @@ -1,14 +1,5 @@ --- TODO this is kinda shitty -local function dirname(str, sep) - sep = sep or "/" - return str:match("(.*" .. sep .. ")") -end - -local script_dir = dirname(arg[0]) -package.path = script_dir .. "/../lua/?.lua;" .. package.path - -local Trie = require "trie" -local nvim = require "nvim" +local Trie = require "colorizer.trie" +local color_map = vim.api.nvim_get_color_map local function print_color_trie() local tohex = bit.tohex @@ -20,7 +11,7 @@ local function print_color_trie() } local COLOR_MAP = {} local COLOR_TRIE = Trie() - for k, v in pairs(nvim.get_color_map()) do + for k, v in pairs(color_map()) do if not (COLOR_NAME_SETTINGS.strip_digits and k:match "%d+$") then COLOR_NAME_MINLEN = COLOR_NAME_MINLEN and min(#k, COLOR_NAME_MINLEN) or #k COLOR_NAME_MAXLEN = COLOR_NAME_MAXLEN and max(#k, COLOR_NAME_MAXLEN) or #k |