change os.execute() to io.popen()
This commit is contained in:
@@ -22,18 +22,19 @@ vim.g.nvim_tree_add_trailing = 1
|
|||||||
vim.g.nvim_tree_indent_markers = 1
|
vim.g.nvim_tree_indent_markers = 1
|
||||||
vim.g.nvim_tree_group_empty = 1
|
vim.g.nvim_tree_group_empty = 1
|
||||||
|
|
||||||
-- TODO: don't know if these keymaps are working on windows, need to check
|
|
||||||
local function git_stage(node)
|
local function git_stage(node)
|
||||||
local cwd = vim.loop.cwd()
|
local cwd = vim.loop.cwd()
|
||||||
local relative_path = string.gsub(node.absolute_path, cwd .. "/", "")
|
local relative_path = string.gsub(node.absolute_path, cwd .. "/", "")
|
||||||
|
|
||||||
os.execute("git stage " .. relative_path)
|
local f = io.popen("git add " .. relative_path, "r")
|
||||||
|
f:close()
|
||||||
end
|
end
|
||||||
local function git_reset(node)
|
local function git_reset(node)
|
||||||
local cwd = vim.loop.cwd()
|
local cwd = vim.loop.cwd()
|
||||||
local relative_path = string.gsub(node.absolute_path, cwd .. "/", "")
|
local relative_path = string.gsub(node.absolute_path, cwd .. "/", "")
|
||||||
|
|
||||||
os.execute("git reset " .. relative_path)
|
local f = io.popen("git reset " .. relative_path, "r")
|
||||||
|
f:close()
|
||||||
end
|
end
|
||||||
-- TODO: add here keymap for git diff window
|
-- TODO: add here keymap for git diff window
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user