Skip to content

Commit da6a766

Browse files
committed
make marker symbols have one utf8 char width
1 parent 53cbba4 commit da6a766

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lua/nvim-tree/renderer/components/padding.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ function M.setup(opts)
9595
if M.config.indent_width < 1 then
9696
M.config.indent_width = 1
9797
end
98+
99+
local function check_marker(symbol)
100+
if #symbol == 0 then
101+
return " "
102+
end
103+
return symbol:match("[%z\1-\127\194-\244][\128-\191]*")
104+
end
105+
106+
for k, v in pairs(M.config.indent_markers.icons) do
107+
M.config.indent_markers.icons[k] = check_marker(v)
108+
end
98109
end
99110

100111
return M

0 commit comments

Comments
 (0)