From 04bd042869c20e5727e4626591167d2301e981f8 Mon Sep 17 00:00:00 2001 From: kyazdani42 Date: Fri, 7 Feb 2020 21:24:08 +0100 Subject: [PATCH] update readme --- README.md | 14 +++++++++----- lua/tree.lua | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f629994e..90d56f06 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,22 @@ ## Notice -- This plugin is under development, it does not yet have all basic functionnalities required by an explorer. - I am working on this plugin to learn lua, learn neovim api and create a **simple** file explorer with features i need. - I really don't like any of the vim trees, they are all too complicated for their purposes and are kind of buggy. I have my shell to do most commands. -- This plugin wont work on windows. +- This plugin does not work on windows. -## Goals / Features +## TODO - [x] moving around the file structure like any basic tree - [x] open file in current buffer or in split with FzF like bindings (CR, C-v, C-x) -- [x] icons for files - [ ] add / delete file in directory -- [ ] quickly find file in the directory structure +- [x] icons for files - [ ] syntax highlighting +- [ ] quickly find file in the directory structure - [ ] simple git integration (color of file changing when staged/changed) +- [ ] update automatically on window change +## TOFIX + +- [ ] handle permissions properly +- [ ] buffer / window should always stay on the left and never disappear (open a file with only the tree open to reproduce this bug) diff --git a/lua/tree.lua b/lua/tree.lua index 087bc83d..b737178a 100644 --- a/lua/tree.lua +++ b/lua/tree.lua @@ -6,7 +6,8 @@ local BUF_NAME = '_LuaTree_' local ROOT_PATH = string.sub(sys('pwd'), 1, -2) .. '/' -- get rid of \n and add leading '/' local function is_dir(path) - return string.match(sys('ls -l '..path), 'total [0-9].*') ~= nil + local file_list = sys('ls -l '..path) + return string.match(file_list, 'total [0-9].*') ~= nil end local function sort_dirs(dirs) @@ -148,7 +149,6 @@ local function update_view() if not buf then return end local cursor_pos = api.nvim_win_get_cursor(0) - cursor_pos[2] = 4 api.nvim_buf_set_option(buf, 'modifiable', true) api.nvim_buf_set_lines(buf, 0, -1, false, format_tree(Tree)) api.nvim_buf_set_option(buf, 'modifiable', false)