From a97af306c4e9c9a6fa7c886c0ffe3079822c5203 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 20 Aug 2021 11:11:24 -0400 Subject: feat(performance): Major performance improvements using async v2 from @oberblastmeister (#987) * start: Working w/ async jobs * short circuit to using bad finder if you pass writer. --- lua/telescope/_compat.lua | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 lua/telescope/_compat.lua (limited to 'lua/telescope/_compat.lua') diff --git a/lua/telescope/_compat.lua b/lua/telescope/_compat.lua deleted file mode 100644 index 42a3dfd..0000000 --- a/lua/telescope/_compat.lua +++ /dev/null @@ -1,56 +0,0 @@ -vim.deepcopy = (function() - local function _id(v) - return v - end - - local deepcopy_funcs = { - table = function(orig) - local copy = {} - - if vim._empty_dict_mt ~= nil and getmetatable(orig) == vim._empty_dict_mt then - copy = vim.empty_dict() - end - - for k, v in pairs(orig) do - copy[vim.deepcopy(k)] = vim.deepcopy(v) - end - - if getmetatable(orig) then - setmetatable(copy, getmetatable(orig)) - end - - return copy - end, - ["function"] = _id or function(orig) - local ok, dumped = pcall(string.dump, orig) - if not ok then - error(debug.traceback(dumped)) - end - - local cloned = loadstring(dumped) - local i = 1 - while true do - local name = debug.getupvalue(orig, i) - if not name then - break - end - debug.upvaluejoin(cloned, i, orig, i) - i = i + 1 - end - return cloned - end, - number = _id, - string = _id, - ["nil"] = _id, - boolean = _id, - } - - return function(orig) - local f = deepcopy_funcs[type(orig)] - if f then - return f(orig) - else - error("Cannot deepcopy object of type " .. type(orig)) - end - end -end)() -- cgit v1.2.3