11local M = {}
22local a = require " telescope.actions"
3+ local action_set = require " telescope.actions.set"
34local s = require " telescope.actions.state"
45local finder = require (" telescope.finders" ).new_table
56local picker = require (" telescope.pickers" ).new
@@ -8,9 +9,10 @@ local maker = require("telescope.pickers.entry_display").create
89local xbase = require " xbase"
910local watch = require " xbase.watch"
1011
11- local handle_action = function (bufnr )
12+ local handle_action = function (direction , bufnr )
1213 a .close (bufnr )
1314 local selected = s .get_selected_entry ()
15+ selected .direction = direction
1416
1517 if selected .command == " Build" then
1618 xbase .build (selected )
@@ -105,7 +107,9 @@ M.watch = function(opts)
105107 end ,
106108 },
107109 attach_mappings = function (_ , _ )
108- a .select_default :replace (handle_action )
110+ a .select_default :replace (function (bufnr )
111+ handle_action (nil , bufnr )
112+ end )
109113 return true
110114 end ,
111115 }):find ()
@@ -160,7 +164,9 @@ M.build_run = function(command, opts)
160164 end ,
161165 },
162166 attach_mappings = function (_ , _ )
163- a .select_default :replace (handle_action )
167+ action_set .select :replace (function (bufnr , direction )
168+ handle_action (direction , bufnr )
169+ end )
164170 return true
165171 end ,
166172 }):find ()
0 commit comments