summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lua/netrw-icons/parse.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/lua/netrw-icons/parse.lua b/lua/netrw-icons/parse.lua
index cd7ba79..d2692af 100644
--- a/lua/netrw-icons/parse.lua
+++ b/lua/netrw-icons/parse.lua
@@ -49,31 +49,31 @@ end
---@param line string
---@return rwNode|nil
local parse_liststyle_1 = function(line)
- local current_dir = vim.b.netrw_curdier;
- local type = M.TYPE_FILE;
+ local node = {};
+ node.type = M.TYPE_FILE;
+ node.icon = 0;
- local name = line:match("^(%S+)")
+ node.name = line:match("^(%S+)")
- if name:sub(-1) == "*" then
- type = M.TYPE_EXE;
+ if node.name:sub(-1) == "*" then
+ node.type = M.TYPE_EXE;
+ return node;
end
local _, _, link, link_target = string.find(line, "^(.+)@%s+")
if link then
- type = M.TYPE_SYMLINK;
- name = link_target;
+ node.type = M.TYPE_SYMLINK;
+ node.name = link_target;
+ return node;
end
local _, _, dir = string.find(line, "^(.*)/")
if dir then
- type = M.TYPE_DIR;
+ node.type = M.TYPE_DIR;
+ return node;
end
- return {
- name = name,
- icon = 0,
- type = type,
- }
+ return node;
end
---@param line string