mirror of
https://github.com/kristoferssolo/runner.nvim.git
synced 2026-02-04 06:12:01 +00:00
Allow shell_handler position to be set by Telescope (#8)
This commit is contained in:
@@ -5,6 +5,7 @@ local action_state = require('telescope.actions.state')
|
||||
local sorters = require('telescope.sorters')
|
||||
local themes = require('telescope.themes')
|
||||
|
||||
local config = require('runner.config')
|
||||
local utils = require('runner.handlers.utils')
|
||||
|
||||
local M = {}
|
||||
@@ -60,6 +61,26 @@ M.choice = function(handlers)
|
||||
local handler_name = action_state.get_selected_entry()[1]
|
||||
handlers[handler_name](buffer)
|
||||
end)
|
||||
actions.select_horizontal:replace(function()
|
||||
local default_position = config.options.position
|
||||
config.options.position = 'bottom'
|
||||
|
||||
actions.close(prompt_bufnr)
|
||||
local handler_name = action_state.get_selected_entry()[1]
|
||||
handlers[handler_name](buffer)
|
||||
|
||||
config.options.position = default_position
|
||||
end)
|
||||
actions.select_vertical:replace(function()
|
||||
local default_position = config.options.position
|
||||
config.options.position = 'top'
|
||||
|
||||
actions.close(prompt_bufnr)
|
||||
local handler_name = action_state.get_selected_entry()[1]
|
||||
handlers[handler_name](buffer)
|
||||
|
||||
config.options.position = default_position
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user