feat: add highlight on matching chars in results buffer

This commit is contained in:
Ade Attwood 2022-07-23 20:53:07 +01:00
parent 9b3d186701
commit 39e6878b58
2 changed files with 10 additions and 4 deletions

View file

@ -19,15 +19,19 @@ end
controller.input = function(char)
prompt.input(char)
vim.schedule(function()
window.set_items(controller.items(prompt.text()))
end)
controller.update(prompt.text())
end
controller.search = function(value)
prompt.set(value)
controller.update(prompt.text())
end
controller.update = function(text)
vim.schedule(function()
window.set_items(controller.items(prompt.text()))
window.set_items(controller.items(text))
vim.cmd("syntax clear IvyMatch")
vim.cmd("syntax match IvyMatch '[(" .. text .. ")]'")
end)
end

View file

@ -67,3 +67,5 @@ end, { bang = true, desc = "List all of the current open buffers" })
vim.api.nvim_set_keymap("n", "<leader>b", "<cmd>IvyBuffers<CR>", { nowait = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>p", "<cmd>IvyFd<CR>", { nowait = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>/", "<cmd>IvyAg<CR>", { nowait = true, silent = true })
vim.cmd "highlight IvyMatch cterm=bold"