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

Case sensitive when completion source is in a non-latin language #2113

Open
2 tasks done
RobberFox opened this issue Dec 12, 2024 · 0 comments
Open
2 tasks done

Case sensitive when completion source is in a non-latin language #2113

RobberFox opened this issue Dec 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RobberFox
Copy link

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
	local lazyrepo = "https://github.com/folke/lazy.nvim.git"
	local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
	if vim.v.shell_error ~= 0 then
		vim.api.nvim_echo({
			{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
			{ out, "WarningMsg" },
			{ "\nPress any key to exit..." },
		}, true, {})
		vim.fn.getchar()
		os.exit(1)
	end
end

vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
	spec = {
		{
			'hrsh7th/nvim-cmp',
			event = 'InsertEnter',
			dependencies = {
				'saadparwaiz1/cmp_luasnip',
				'hrsh7th/cmp-nvim-lsp',
				'hrsh7th/cmp-path',
			},

			config = function()
				local cmp = require("cmp")
				local luasnip = require("luasnip")

				cmp.setup {
					snippet = {
						expand = function(args)
							luasnip.lsp_expand(args.body)
						end,
					},
					completion = { completeopt = "menu,menuone,noinsert" },

					-- See `:help ins-completion`
					mapping = {
						["<C-n>"] = cmp.mapping.select_next_item(),
						["<C-p>"] = cmp.mapping.select_prev_item(),
						["<C-y>"] = cmp.mapping.confirm { select = true },
					},
					sources = {
						{ name = "luasnip" },
					},
				}
			end,
		},

		{
			"L3MON4D3/LuaSnip",
			version = "v2.*",
			build = "make install_jsregexp",

			config = function()
				local ls = require("luasnip")
				local s = ls.snippet
				local t = ls.text_node

				ls.add_snippets("all", {
					s({ trig="МУЛ" }, t">[!multi-column]"),
				})
			end
		},
	},
})

You can replace "МУЛ" with some other non-latin language

Description

When I have a completion source in a foreign language (let it be a luasnip snippet, or a markdown note filename, etc.)

-- Luasnip for this example:
s({ trig="МУЛ" }, t">[!multi-column]"),

Then the smartcase doesn't work, so I have to explicitly type uppercase МУЛ instead of мул.

Steps to reproduce

Start inserting мул, there is no completion pop-up. But with МУЛ there is.

Expected behavior

Smartcase behaviour, so that мул matches МУЛ.

Actual behavior

I have to explicitly type uppercase characters.

Additional context

No response

@RobberFox RobberFox added the bug Something isn't working label Dec 12, 2024
@RobberFox RobberFox changed the title Case sensitive when completion source in a non-latin language Case sensitive when completion source is in a non-latin language Dec 15, 2024
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

1 participant