summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorzbq <zhengbaiqiang@gmail.com>2022-11-29 05:41:37 +0800
committerGitHub <noreply@github.com>2022-11-28 22:41:37 +0100
commit3c2e5fb23e9f6ca1aa682ae16bac3319bfe03e38 (patch)
tree445402b9012bed7dfa1e3ca38e69dedd2c624e0c /lua/telescope/make_entry.lua
parent4d77743a8ec4d19b3c47e0d04f3e88f1a933698e (diff)
feat: add configuration to fix encoding of output of find_command in find_files (#2232)
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua11
1 files changed, 9 insertions, 2 deletions
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