telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

`smartcase` doesn't work when searching non-latin filenames

Open RobberFox opened this issue 1 year ago • 4 comments

Description

When using telescope builtin find_files for filenames in non-latin languages, the smartcase option doesn't work. image 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

  1. nvim -nu minimal.lua
  2. :Telescope find_files and 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",
})

RobberFox avatar Oct 23 '24 17:10 RobberFox

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' },
    },
  },

image

However in shell fd show case-insensitive result.

~/notes/vault-13
❯ fd --type f --ignore-case "что"
Во что поиграть.md
Что делать после установки Fedora.md
Что посмотреть.md
Что почитать.md

SappyJoy avatar Oct 27 '24 19:10 SappyJoy

I've switched to fzf-lua and it doesn't have this issue.

RobberFox avatar Dec 11 '24 20:12 RobberFox

Same problem with greek letters in file names

hermannsorgel avatar Feb 20 '25 07:02 hermannsorgel

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.

jamestrew avatar Feb 26 '25 21:02 jamestrew