From 55fbc471d1d44ce5fc1a53828e614ba86e4028be Mon Sep 17 00:00:00 2001 From: kiyan42 Date: Thu, 20 Feb 2020 12:18:43 +0100 Subject: [PATCH] fix bug on format --- lua/lib/format.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lua/lib/format.lua b/lua/lib/format.lua index 7ea84052..74a9d255 100644 --- a/lua/lib/format.lua +++ b/lua/lib/format.lua @@ -114,12 +114,13 @@ local function highlight_line(buffer) vim.api.nvim_buf_add_highlight(buffer, -1, group, line, from, to) end return function(line, node) - local text_start = node.depth * 2 + 4 + local text_start = node.depth * 2 local gitlen = string.len(node.git) if node.name == '..' then highlight('LuaTreeFolderName', line, 0, -1) elseif node.dir == true then + text_start = text_start + 4 highlight('LuaTreeFolderIcon', line, 0, text_start) highlight('LuaTreeFolderName', line, text_start + gitlen, -1) @@ -127,20 +128,18 @@ local function highlight_line(buffer) highlight('LuaTreeSymlink', line, 0, -1) elseif is_special(node.name) == true then - text_start = text_start - 4 highlight('LuaTreeSpecialFile', line, text_start + gitlen, -1) elseif is_executable(node.path .. node.name) then - text_start = text_start - 4 highlight('LuaTreeExecFile', line, text_start + gitlen, -1) elseif is_pic(node.path .. node.name) then - text_start = text_start - 4 highlight('LuaTreeImageFile', line, text_start + gitlen, -1) else for k, v in pairs(HIGHLIGHT_GROUPS) do if string.match(node.name, k) ~= nil then + text_start = text_start + 4 highlight('LuaTree' .. v, line, 0, text_start) break end