diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2021-08-20 11:11:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-20 11:11:24 -0400 |
| commit | a97af306c4e9c9a6fa7c886c0ffe3079822c5203 (patch) | |
| tree | f5e2b50a767e93618d0d8fdddb8a964c90633c8a /lua/telescope/_compat.lua | |
| parent | d6d28dbe324de9826a579155076873888169ba0f (diff) | |
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.
Diffstat (limited to 'lua/telescope/_compat.lua')
| -rw-r--r-- | lua/telescope/_compat.lua | 56 |
1 files changed, 0 insertions, 56 deletions
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)() |
