From 42beb30dfb08202172ec16090b4f553556f475fc Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Sun, 5 Oct 2025 00:44:12 +0200 Subject: [PATCH] fix(util): remove unused functions --- lua/util.lua | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/lua/util.lua b/lua/util.lua index bae0eb5..b65b5d1 100644 --- a/lua/util.lua +++ b/lua/util.lua @@ -4,44 +4,6 @@ local Util = {} Util.os_name = vim.uv.os_uname().sysname ---- Get the module path of a file ----@param file string ----@return string|nil -local function get_module_path(file) - for _, rtp in ipairs(vim.api.nvim_list_runtime_paths()) do - if file:sub(1, #rtp) == rtp then - file = file:sub(#rtp + 2) - - if file:sub(1, 4) == "lua/" then - file = file:sub(5) - end - - return file:match("(.*)%.lua$"):gsub("[/\\]", ".") - end - end -end - ---- Send a notification ----@param msg string Message to send ----@param title? string Title of notification ----@param level integer Log level -local function notify(msg, title, level) - if not title then - local info = debug.getinfo(3) - local file = info.source - and (info.source:sub(1, 1) == "@" and info.source:sub(2) or info.source) - or nil - local module = file and (get_module_path(file) or file) or nil - title = module - and module .. (info.name and info.name ~= "" and ":" .. info.name or "") - or nil - end - if title and not pcall(require, "notify") then - msg = "[" .. title .. "] " .. msg - end - vim.notify(msg, level, { title = title }) -end - --- Check that an executable is available --- @param exe string Array to look for --- @return boolean