Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartcase doesn't work when searching non-latin filenames #3337

Open
RobberFox opened this issue Oct 23, 2024 · 1 comment
Open

smartcase doesn't work when searching non-latin filenames #3337

RobberFox opened this issue Oct 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@RobberFox
Copy link

RobberFox commented Oct 23, 2024

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 RobberFox added the bug Something isn't working label Oct 23, 2024
@SappyJoy
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants