telescope-frecency.nvim/lua/frecency/web_devicons.lua
JINNOUCHI Yasushi c140e6ff9c
feat: make query() faster and more lazier (#241)
* refactor: simplify logic to load web_devicons

* refactor: make register() asynchronous

* fix: load lazily modules outside this plugin

* refactor: simplify logic to wait initialization

* refactor: use uv.hrtime() instead of os.clock()

* fix: avoid errors in calling plenary.log in async

* test: store elapsed time to check in tests

* test: fix module names

This becomes a problem only in Ubuntu because macOS and Windows does not
care cases in filenames.

* test: fix types and unused modules

* style: fix by stylua

* refactor: make recency / entry_maker loaded lazily
2024-08-25 19:28:52 +09:00

15 lines
345 B
Lua

---@class FrecencyWebDevicons
local M = {
---@param name string?
---@param ext string?
---@param opts table?
---@return string
---@return string
get_icon = function(name, ext, opts)
local ok, web_devicons = pcall(require, "nvim-web-devicons")
return ok and web_devicons.get_icon(name, ext, opts) or "", ""
end,
}
return M