reorganize code

This commit is contained in:
kiyan42
2020-02-18 15:33:43 +01:00
parent 7b7fb56c4e
commit b448b1a0fa
5 changed files with 355 additions and 251 deletions

View File

@@ -1,6 +1,8 @@
local api = vim.api
local buf, win
local system = function(v) api.nvim_call_function('system', { v }) end
-- local update_tree_view = require ''
local update_tree_state = require 'lib/state'.update_tree
local EDIT_FILE = nil
@@ -109,6 +111,8 @@ local function add_file(path)
system('touch ' .. path)
end
api.nvim_command("q!")
update_tree_state()
update_tree_view(true)
end
local function remove_file(confirmation)
@@ -117,12 +121,16 @@ local function remove_file(confirmation)
end
EDIT_FILE = nil
api.nvim_command("q!")
update_tree_state()
update_tree_view(true)
end
local function rename_file(path)
system('mv '..EDIT_FILE..' '..path)
EDIT_FILE = nil
api.nvim_command("q!")
update_tree_state()
update_tree_view(true)
end
return {