summaryrefslogtreecommitdiff
path: root/lua/telescope/init.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-11 00:14:37 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-11 00:14:40 -0400
commit382c491380719e4667a74c7ccc58222b290f7e67 (patch)
tree5cb9fcfc49f0821a1d8273233ade930efbfe6084 /lua/telescope/init.lua
parentfe387d10db66dc9b33388f05fadabbdc9b31c28b (diff)
feat: Add some more layout options
Diffstat (limited to 'lua/telescope/init.lua')
-rw-r--r--lua/telescope/init.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/lua/telescope/init.lua b/lua/telescope/init.lua
index 38c27ff..c0a4e37 100644
--- a/lua/telescope/init.lua
+++ b/lua/telescope/init.lua
@@ -47,4 +47,38 @@ function telescope.setup(opts)
require('telescope.config').set_defaults(opts.defaults)
end
+-- Until I have better profiling stuff, this will have to do.
+PERF = function(...) end
+PERF_DEBUG = PERF_DEBUG or nil
+START = nil
+
+if PERF_DEBUG then
+ PERF = function(...)
+ local new_time = (vim.loop.hrtime() - START) / 1E9
+ if select('#', ...) == 0 then
+ vim.schedule(function()
+ vim.api.nvim_buf_set_lines(PERF_DEBUG, -1, -1, false, { '' })
+ end)
+ return
+ end
+
+ local to_insert = ''
+ if START then
+ to_insert = tostring(new_time) .. ' | '
+ end
+
+ for _, v in ipairs({...}) do
+ if type(v) == 'table' then
+ to_insert = to_insert .. tostring(#v) .. ' | '
+ else
+ to_insert = to_insert .. tostring(v) .. ' | '
+ end
+ end
+
+ vim.schedule(function()
+ vim.api.nvim_buf_set_lines(PERF_DEBUG, -1, -1, false, { to_insert })
+ end)
+ end
+end
+
return telescope