mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
feat(picker.actions): added separate hl group for pick win current
This commit is contained in:
parent
f03a17c48d
commit
9b80e444f5
2 changed files with 7 additions and 4 deletions
|
@ -135,7 +135,7 @@ function M.pick_win(picker, item, action)
|
|||
height = 3,
|
||||
text = (" \n %s \n "):format(c),
|
||||
wo = {
|
||||
winhighlight = "NormalFloat:SnacksPickerPickWin",
|
||||
winhighlight = "NormalFloat:SnacksPickerPickWin" .. (win == picker.main and "Current" or ""),
|
||||
},
|
||||
})
|
||||
end
|
||||
|
@ -145,9 +145,11 @@ function M.pick_win(picker, item, action)
|
|||
for _, overlay in pairs(overlays) do
|
||||
overlay:close()
|
||||
end
|
||||
local win = overlays[char]
|
||||
local win = Snacks.util.keycode("<cr>") or overlays[char]
|
||||
if win then
|
||||
picker.main = win.opts.win
|
||||
if type(win) == "table" then
|
||||
picker.main = win.opts.win
|
||||
end
|
||||
vim.defer_fn(function()
|
||||
if not picker.closed then
|
||||
picker.layout:unhide()
|
||||
|
|
|
@ -65,7 +65,8 @@ Snacks.util.set_hl({
|
|||
GitStatusCopied = "SnacksPickerGitStatus",
|
||||
GitStatusUntracked = "SnacksPickerGitStatus",
|
||||
ManSection = "Number",
|
||||
PickWin = "DiagnosticVirtualTextError",
|
||||
PickWin = "Search",
|
||||
PickWinCurrent = "CurSearch",
|
||||
ManPage = "Special",
|
||||
-- Icons
|
||||
Icon = "Special",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue