Made lite set project dir to CWD; removed core.project_dir

Fixes #100
This commit is contained in:
rxi
2020-05-17 17:05:56 +01:00
parent c1f731e5a1
commit 4ae0d477c0
4 changed files with 21 additions and 15 deletions
+2 -3
View File
@@ -35,7 +35,7 @@ function TreeView:get_cached(item)
t = {}
t.filename = item.filename
t.abs_filename = system.absolute_path(item.filename)
t.path, t.name = t.filename:match("^(.*)[\\/](.+)$")
t.name = t.filename:match("[^\\/]+$")
t.depth = get_depth(t.filename)
t.type = item.type
self.cache[t.filename] = t
@@ -143,7 +143,6 @@ function TreeView:draw()
local icon_width = style.icon_font:get_width("D")
local spacing = style.font:get_width(" ") * 2
local root_depth = get_depth(core.project_dir) + 1
local doc = core.active_view.doc
local active_filename = doc and system.absolute_path(doc.filename or "")
@@ -163,7 +162,7 @@ function TreeView:draw()
end
-- icons
x = x + (item.depth - root_depth) * style.padding.x + style.padding.x
x = x + item.depth * style.padding.x + style.padding.x
if item.type == "dir" then
local icon1 = item.expanded and "-" or "+"
local icon2 = item.expanded and "D" or "d"