From 3c2e5fb23e9f6ca1aa682ae16bac3319bfe03e38 Mon Sep 17 00:00:00 2001 From: zbq Date: Tue, 29 Nov 2022 05:41:37 +0800 Subject: feat: add configuration to fix encoding of output of find_command in find_files (#2232) --- lua/telescope/make_entry.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 699145c..19e3674 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -192,8 +192,15 @@ do return rawget(t, rawget(lookup_keys, k)) end - return function(line) - return setmetatable({ line }, mt_file_entry) + if opts.file_entry_encoding then + return function(line) + line = vim.iconv(line, opts.file_entry_encoding, "utf8") + return setmetatable({ line }, mt_file_entry) + end + else + return function(line) + return setmetatable({ line }, mt_file_entry) + end end end end -- cgit v1.2.3