Skip to content

Commit

Permalink
feat: make matched strings more discernable
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Jan 7, 2024
1 parent f694e0b commit 1711957
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lua/import/picker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ local function picker(opts)
end

-- add syntax highlighting to the rsults of the picker
local currentFiletye = vim.bo.filetype
local currentFiletype = vim.bo.filetype
vim.api.nvim_create_autocmd("FileType", {
pattern = "TelescopeResults",
once = true, -- do not affect other Telescope windows
callback = function() vim.bo.filetype = currentFiletye end,
pattern = "TelescopeResults",
once = true, -- do not affect other Telescope windows
callback = function(ctx)
-- add filetype highlighting
vim.api.nvim_buf_set_option(ctx.buf, "filetype", currentFiletype)

-- make discernible as the results are now colored
local ns = vim.api.nvim_create_namespace("telescope-import")
vim.api.nvim_win_set_hl_ns(0, ns)
vim.api.nvim_set_hl(ns, "TelescopeMatching", { reverse = true })
end,
})

pickers
Expand Down

0 comments on commit 1711957

Please sign in to comment.