We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
0.10.2
Nixos 25.05
The vim.ui.input override of noice.nvim calls the highlight function passed to it, but doesn't actually apply the highlights.
The text in the input field is properly highlighted
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.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "--single-branch", "https://github.com/folke/lazy.nvim.git", lazypath, }) end vim.opt.runtimepath:prepend(lazypath) -- install plugins local plugins = { "folke/tokyonight.nvim", { "folke/noice.nvim", dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify", }, }, } require("lazy").setup(plugins, { root = root .. "/plugins", }) -- add anything else here vim.opt.termguicolors = true vim.cmd([[colorscheme tokyonight]]) require("noice").setup() vim.keymap.set("n", "<space>", function() vim.ui.input({ prompt = "Enter lua code: ", highlight = function(input) local parser = vim.treesitter.get_string_parser(input, "lua") local tree = parser:parse()[1] local query = vim.treesitter.query.get("lua", "highlights") -- This isn't complete, but will do for our purposes local highlights = {} for id, node in query:iter_captures(tree:root(), input) do local _, cstart, _, cend = node:range() local hl = { cstart, cend, "@" .. query.captures[id] } if cstart >= #input then goto skip end for i, inner in ipairs(highlights) do if inner[1] < cend and inner[2] > cstart then highlights[i] = hl goto skip end end table.insert(highlights, hl) ::skip:: end return highlights end }, function() end) end)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Did you check docs and existing issues?
Neovim version (nvim -v)
0.10.2
Operating system/version
Nixos 25.05
Describe the bug
The vim.ui.input override of noice.nvim calls the highlight function passed to it, but doesn't actually apply the highlights.
Steps To Reproduce
Expected Behavior
The text in the input field is properly highlighted
Repro
The text was updated successfully, but these errors were encountered: