We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 630305c commit 39d0455Copy full SHA for 39d0455
lua/nvim-tree/view.lua
@@ -211,8 +211,12 @@ local function grow()
211
local lines = vim.api.nvim_buf_get_lines(M.get_bufnr(), starts_at, -1, false)
212
local max_length = M.View.initial_width
213
for _, l in pairs(lines) do
214
- if max_length < #l then
215
- max_length = #l
+ -- count of unicode codepoints.
+ -- (#l counts the bytes in the string which is not desirable)
216
+ local _, count = string.gsub(l, "[^\128-\193]", "")
217
+ count = count + 3 -- add padding
218
+ if max_length < count then
219
+ max_length = count
220
end
221
222
M.resize(max_length)
0 commit comments