telescope.nvim
telescope.nvim copied to clipboard
`smartcase` doesn't work when searching non-latin filenames
Description
When using telescope builtin find_files for filenames in non-latin languages, the smartcase option doesn't work.
Here I have to explicitly type the uppercase
Ф,П characters
P.S. I use neovim for note-taking and some of my filenames are in non-latin langages (armenian, russian, etc.)
Neovim version
NVIM v0.11.0-dev-532+gc9b129a02
Build type: RelWithDebInfo
LuaJIT 2.1.1720049189
Operating system and version
Debian Linux 12 x86_64
Telescope version / branch / rev
0.1.x
checkhealth telescope
==============================================================================
telescope: require("telescope.health").check()
Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies ~
- OK rg: found ripgrep 14.1.0 (rev e50df40a19)
- OK fd: found fdfind 8.6.0
===== Installed extensions ===== ~
Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured
Telescope Extension: `ui-select` ~
- No healthcheck provided
Steps to reproduce
nvim -nu minimal.lua:Telescope find_filesand search in lowercase (sayфунк дирих) for a filename in non-latin language, likeФункция-Дирихле.md
Expected behavior
I would expect the smartcase behaviour to work in non-latin languages the same way it does in english.
So, func diric pattern matches a filename Function-Dirichlet.md and функ дирих is expected to match Функция-Дирихле.md
Actual behavior
функ дирих doesn't match Функция-Дирихле.md
Minimal config
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs { "config", "data", "state", "cache" } do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system {
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
}
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
-- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
require("telescope").setup {}
end,
},
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'markdown', 'markdown_inline' }, -- to avoid errors
},
config = function(_, opts)
require('nvim-treesitter.configs').setup(opts)
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
Also saw this behavior. Switched to fd, but it didn't help
pickers = {
find_files = {
find_command = { 'fd', '--type', 'f', '--ignore-case', '--hidden', '--strip-cwd-prefix' },
},
},
However in shell fd show case-insensitive result.
~/notes/vault-13
❯ fd --type f --ignore-case "что"
Во что поиграть.md
Что делать после установки Fedora.md
Что посмотреть.md
Что почитать.md
I've switched to fzf-lua and it doesn't have this issue.
Same problem with greek letters in file names
telescope-fzf-native doesn't yet support this. It's been on the to-do list for over 4 years I wanna say but doesn't look like it's happening anytime soon.