From f9b36bf730fda5488be87b91fd03a6f7cbf64e73 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Wed, 24 Apr 2024 03:34:52 +0300 Subject: refactor: full rewrite --- lua/cmake-explorer/cache.lua | 47 -------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 lua/cmake-explorer/cache.lua (limited to 'lua/cmake-explorer/cache.lua') diff --git a/lua/cmake-explorer/cache.lua b/lua/cmake-explorer/cache.lua deleted file mode 100644 index 046a9f9..0000000 --- a/lua/cmake-explorer/cache.lua +++ /dev/null @@ -1,47 +0,0 @@ -local Cache = {} - -local os = { - iswin32 = vim.fn.has("win32") == 1, - ismac = vim.fn.has("mac") == 1, - iswsl = vim.fn.has("wsl") == 1, - islinux = vim.fn.has("linux") == 1, -} - -local dir = { - unix = vim.fn.expand("~") .. "/.cache/cmake_explorer_nvim/", - mac = vim.fn.expand("~") .. "/.cache/cmake_explorer_nvim/", - win = vim.fn.expand("~") .. "/AppData/Local/cmake_explorer_nvim/", -} - -local function get_cache_path() - if os.islinux then - return dir.unix - elseif os.ismac then - return dir.mac - elseif os.iswsl then - return dir.unix - elseif os.iswin32 then - return dir.win - end -end - -local function get_clean_path(path) - local current_path = path - local clean_path = current_path:gsub("/", "") - clean_path = clean_path:gsub("\\", "") - clean_path = clean_path:gsub(":", "") - return clean_path -end - -function Cache.load(path) - return -end - -function Cache.save_global(tbl) - local to_save = vim.tbl_deep_extend("keep", tbl) - setmetatable(to_save, nil) - local path = get_project_path() - local file = io.open(path, "w") -end - -return Cache -- cgit v1.2.3