From 64e59060b1750d0c86761693b6847c3db07afcd2 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Thu, 8 Apr 2021 10:35:44 -0400 Subject: feat: asyncify pickers - except for live_grep (#709) * something kind of works already * yayayayayayayayayayayayayayayayayayayayayayayayayayayayayayayayaya * use async for everything besides live jobs * fix: fixup autocmds previewer * fix: lints for prime * temp: Add example of how we can think about async sorters * feat: Allow picker to decide when to cancel * fix: simplify scoring logic and tests * fixup: name * fix: Move back towards more backwards compat methods * fixup: Remove results from opts * fixup: remove trailing quote * fixup: Attempt to clean up some more async items. Next is status * wip: Add todo for when bfredl implements extmarks over the EOL * wip * fixup: got em * fixup: cleaning * fixup: docs --- lua/telescope/pickers/window.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lua/telescope/pickers/window.lua (limited to 'lua/telescope/pickers/window.lua') diff --git a/lua/telescope/pickers/window.lua b/lua/telescope/pickers/window.lua new file mode 100644 index 0000000..76c1fe0 --- /dev/null +++ b/lua/telescope/pickers/window.lua @@ -0,0 +1,17 @@ +local p_layouts = require('telescope.pickers.layout_strategies') + +local p_window = {} + +function p_window.get_window_options(picker, max_columns, max_lines) + local layout_strategy = picker.layout_strategy + local getter = p_layouts[layout_strategy] + + if not getter then + error("Not a valid layout strategy: " .. layout_strategy) + end + + return getter(picker, max_columns, max_lines) +end + + +return p_window -- cgit v1.2.3