diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index e8e9b320..045d5bfa 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -24,25 +24,25 @@ local conf = { }, } local function diagHL() - require("flash").jump({ - matcher = function(win) - ---@param diag Diagnostic - return vim.tbl_map(function(diag) - return { - pos = { diag.lnum + 1, diag.col }, - end_pos = { diag.end_lnum + 1, diag.end_col - 1 }, - } - end, vim.diagnostic.get(vim.api.nvim_win_get_buf(win))) - end, - action = function(match, state) - vim.api.nvim_win_call(match.win, function() - vim.api.nvim_win_set_cursor(match.win, match.pos) - vim.diagnostic.open_float() - end) - state:restore() - end, - }) - end + require("flash").jump({ + matcher = function(win) + ---@param diag Diagnostic + return vim.tbl_map(function(diag) + return { + pos = { diag.lnum + 1, diag.col }, + end_pos = { diag.end_lnum + 1, diag.end_col - 1 }, + } + end, vim.diagnostic.get(vim.api.nvim_win_get_buf(win))) + end, + action = function(match, state) + vim.api.nvim_win_call(match.win, function() + vim.api.nvim_win_set_cursor(match.win, match.pos) + vim.diagnostic.open_float() + end) + state:restore() + end, + }) +end return { "folke/flash.nvim", event = "VeryLazy", @@ -93,7 +93,7 @@ return { { "", mode = { "n", "x", "o" }, - , + diagHL, desc = "Toggle Flash Search", }, },