summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorJINNOUCHI Yasushi <me@delphinus.dev>2021-01-31 18:55:17 +0900
committerGitHub <noreply@github.com>2021-01-31 10:55:17 +0100
commit1ca1e7ccba203752f7b7f89c2bd3aca13586d460 (patch)
tree18dca4487c1a34759b3e7a26a6e8e2c93a1a767f /lua/telescope/make_entry.lua
parent4e0dfa2e705cd34b315315ed4740683988ef5403 (diff)
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>
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index bd1bf73..d23dcb7 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -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 {