AutoYADM commit: 2024-12-02 20:20:03
This commit is contained in:
parent
ed362cfe69
commit
8c1bde4bbc
1 changed files with 20 additions and 20 deletions
|
@ -24,25 +24,25 @@ local conf = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
local function diagHL()
|
local function diagHL()
|
||||||
require("flash").jump({
|
require("flash").jump({
|
||||||
matcher = function(win)
|
matcher = function(win)
|
||||||
---@param diag Diagnostic
|
---@param diag Diagnostic
|
||||||
return vim.tbl_map(function(diag)
|
return vim.tbl_map(function(diag)
|
||||||
return {
|
return {
|
||||||
pos = { diag.lnum + 1, diag.col },
|
pos = { diag.lnum + 1, diag.col },
|
||||||
end_pos = { diag.end_lnum + 1, diag.end_col - 1 },
|
end_pos = { diag.end_lnum + 1, diag.end_col - 1 },
|
||||||
}
|
}
|
||||||
end, vim.diagnostic.get(vim.api.nvim_win_get_buf(win)))
|
end, vim.diagnostic.get(vim.api.nvim_win_get_buf(win)))
|
||||||
end,
|
end,
|
||||||
action = function(match, state)
|
action = function(match, state)
|
||||||
vim.api.nvim_win_call(match.win, function()
|
vim.api.nvim_win_call(match.win, function()
|
||||||
vim.api.nvim_win_set_cursor(match.win, match.pos)
|
vim.api.nvim_win_set_cursor(match.win, match.pos)
|
||||||
vim.diagnostic.open_float()
|
vim.diagnostic.open_float()
|
||||||
end)
|
end)
|
||||||
state:restore()
|
state:restore()
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
"folke/flash.nvim",
|
"folke/flash.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
|
@ -93,7 +93,7 @@ return {
|
||||||
{
|
{
|
||||||
"<c-s>",
|
"<c-s>",
|
||||||
mode = { "n", "x", "o" },
|
mode = { "n", "x", "o" },
|
||||||
,
|
diagHL,
|
||||||
desc = "Toggle Flash Search",
|
desc = "Toggle Flash Search",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue