From 4b3f42514b4a67e8391bb2a515728ab86d72235d Mon Sep 17 00:00:00 2001 From: thefux Date: Sun, 20 Feb 2022 20:54:47 +0100 Subject: [PATCH] update telescope plugin --- lua/telescope/_extensions/lazygit_telescope.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lua/telescope/_extensions/lazygit_telescope.lua b/lua/telescope/_extensions/lazygit_telescope.lua index ab9fd72..f3f0957 100644 --- a/lua/telescope/_extensions/lazygit_telescope.lua +++ b/lua/telescope/_extensions/lazygit_telescope.lua @@ -11,19 +11,15 @@ local conf = require("telescope.config").values local lazygit = require("lazygit") -local function lazygit_toggle(path) +local function open_lazygit(prompt_buf) + local entry = action_state.get_selected_entry() local cmd = [[lua require"lazygit".lazygit('%s')]] - cmd= cmd:format(path:gsub("%s", "")) + local path = entry.value + cmd = cmd:format(path:gsub("%s", "")) vim.api.nvim_command(cmd) vim.api.nvim_buf_set_keymap(0, 't', '', '', {noremap = true, silent = true}) end -local function open_lazygit(prompt_buf) - actions.close(prompt_buf) - local entry = action_state.get_selected_entry() - lazygit_toggle(entry.value) -end - local lazygit_repos = function(opts) local displayer = require("telescope.pickers.entry_display").create {