From 1d5562ec70500feba6c7d612bb26408dd14b4fdd Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Thu, 17 Feb 2022 17:27:50 +0300 Subject: [PATCH] change os.execute() to io.popen() --- config/nvim/lua/user/file-tree.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/nvim/lua/user/file-tree.lua b/config/nvim/lua/user/file-tree.lua index 3e81a78..a2765db 100644 --- a/config/nvim/lua/user/file-tree.lua +++ b/config/nvim/lua/user/file-tree.lua @@ -22,18 +22,19 @@ vim.g.nvim_tree_add_trailing = 1 vim.g.nvim_tree_indent_markers = 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 cwd = vim.loop.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 local function git_reset(node) local cwd = vim.loop.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 -- TODO: add here keymap for git diff window