fix: Multi byte truncate for displayer (#464)

This is needed for calling strdisplaywidth() from Lua loop.

See https://github.com/nvim-telescope/telescope.nvim/issues/414
See https://github.com/neovim/neovim/blob/a1ed941a7881122fda2fd48e71e890ed55e4d08e/src/nvim/eval/funcs.c#L9845-L9858

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
JINNOUCHI Yasushi
2021-01-31 10:55:17 +01:00
committed by GitHub
co-authored by Simon Hauser
parent 4e0dfa2e70
commit 1ca1e7ccba
4 changed files with 138 additions and 9 deletions
+2 -1
View File
@@ -463,7 +463,8 @@ function make_entry.gen_from_buffer(opts)
local icon_width = 0
if not disable_devicons then
icon_width = vim.fn.strdisplaywidth(get_devicons('fname', disable_devicons))
local icon, _ = get_devicons('fname', disable_devicons)
icon_width = utils.strdisplaywidth(icon)
end
local displayer = entry_display.create {