From e6481f8bf9306b6e50bb2da9e1c723fe3c9988ea Mon Sep 17 00:00:00 2001 From: Jiahe Jiang <61075605+Isrothy@users.noreply.github.com> Date: Sun, 12 Apr 2026 10:53:33 +0800 Subject: [PATCH 1/3] feat: use neovim0.12 mark event --- .editorconfig | 3 + lua/neominimap/map/handlers/builtins/init.lua | 305 ++++++++++-------- 2 files changed, 170 insertions(+), 138 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ef4b93c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*.{lua,sh,bash,zsh}] +indent_style = space +indent_size = 4 diff --git a/lua/neominimap/map/handlers/builtins/init.lua b/lua/neominimap/map/handlers/builtins/init.lua index 62e7b3b..759bf81 100644 --- a/lua/neominimap/map/handlers/builtins/init.lua +++ b/lua/neominimap/map/handlers/builtins/init.lua @@ -1,160 +1,189 @@ local api = vim.api local config = require("neominimap.config") ----@type table -return { - git = { - name = "Built-in Git Signs", - mode = config.git.mode, - namespace = api.nvim_create_namespace("neominimap_git"), - autocmds = { - { - event = "User", - opts = { - pattern = "GitSignsUpdate", - desc = "Update git annotations when git signs are updated", - get_buffers = function(args) - local data = args.data - if not data then - return nil - end - ---@type integer - return tonumber(args.data.buffer) - end, - }, +---@type Neominimap.Map.Handler +local git_handler = { + name = "Built-in Git Signs", + mode = config.git.mode, + namespace = api.nvim_create_namespace("neominimap_git"), + autocmds = { + { + event = "User", + opts = { + pattern = "GitSignsUpdate", + desc = "Update git annotations when git signs are updated", + get_buffers = function(args) + local data = args.data + if not data then + return nil + end + ---@type integer + return tonumber(args.data.buffer) + end, }, }, - init = function() end, - get_annotations = function(bufnr) - return require("neominimap.map.handlers.builtins.git").get_annotations(bufnr) - end, }, - mini_diff = { - name = "Built-in Mini Diff", - mode = config.mini_diff.mode, - namespace = api.nvim_create_namespace("neominimap_minidiff"), - autocmds = { - { - event = "User", - opts = { - pattern = "MiniDiffUpdated", - desc = "Update mini diff annotations when mini diff signs are updated", - get_buffers = function(args) - local data = args.data - if not data then - return nil - end - ---@type integer - return tonumber(args.data.buffer) - end, - }, + init = function() end, + get_annotations = function(bufnr) + return require("neominimap.map.handlers.builtins.git").get_annotations(bufnr) + end, +} + +---@type Neominimap.Map.Handler +local mini_diff_handler = { + name = "Built-in Mini Diff", + mode = config.mini_diff.mode, + namespace = api.nvim_create_namespace("neominimap_minidiff"), + autocmds = { + { + event = "User", + opts = { + pattern = "MiniDiffUpdated", + desc = "Update mini diff annotations when mini diff signs are updated", + get_buffers = function(args) + local data = args.data + if not data then + return nil + end + ---@type integer + return tonumber(args.data.buffer) + end, }, }, - init = function() end, - get_annotations = function(bufnr) - return require("neominimap.map.handlers.builtins.mini_diff").get_annotations(bufnr) - end, }, - diagnostic = { - name = "Built-in Diagnostic", - mode = config.diagnostic.mode, - namespace = api.nvim_create_namespace("neominimap_diagnostic"), - autocmds = { - { - event = "DiagnosticChanged", - opts = { - desc = "Update diagnostic annotations when diagnostics are changed", - get_buffers = function(args) - return tonumber(args.buf) - end, - }, + init = function() end, + get_annotations = function(bufnr) + return require("neominimap.map.handlers.builtins.mini_diff").get_annotations(bufnr) + end, +} + +---@type Neominimap.Map.Handler +local diagnostic_handler = { + name = "Built-in Diagnostic", + mode = config.diagnostic.mode, + namespace = api.nvim_create_namespace("neominimap_diagnostic"), + autocmds = { + { + event = "DiagnosticChanged", + opts = { + desc = "Update diagnostic annotations when diagnostics are changed", + get_buffers = function(args) + return tonumber(args.buf) + end, }, }, - init = function() end, - get_annotations = function(bufnr) - return require("neominimap.map.handlers.builtins.diagnostic").get_annotations(bufnr) - end, }, - search = { - name = "Built-in Search", - mode = config.search.mode, - init = function() - require("neominimap.events.search") - end, - namespace = api.nvim_create_namespace("neominimap_search"), - autocmds = { - { - event = "BufWinEnter", - opts = { - desc = "Update search annotations when entering window", - get_buffers = function(_) - return api.nvim_get_current_buf() - end, - }, + init = function() end, + get_annotations = function(bufnr) + return require("neominimap.map.handlers.builtins.diagnostic").get_annotations(bufnr) + end, +} + +---@type Neominimap.Map.Handler +local search_handler = { + name = "Built-in Search", + mode = config.search.mode, + init = function() + require("neominimap.events.search") + end, + namespace = api.nvim_create_namespace("neominimap_search"), + autocmds = { + { + event = "BufWinEnter", + opts = { + desc = "Update search annotations when entering window", + get_buffers = function(_) + return api.nvim_get_current_buf() + end, }, - { - event = "TabEnter", - opts = { - desc = "Update search annotations when entering tab", - get_buffers = function(_) - return require("neominimap.util").get_visible_buffers() - end, - }, + }, + { + event = "TabEnter", + opts = { + desc = "Update search annotations when entering tab", + get_buffers = function(_) + return require("neominimap.util").get_visible_buffers() + end, }, - { - event = "User", - opts = { - pattern = "Search", - desc = "Update search annotations when search event is triggered", - get_buffers = function(_) - return require("neominimap.util").get_visible_buffers() - end, - }, + }, + { + event = "User", + opts = { + pattern = "Search", + desc = "Update search annotations when search event is triggered", + get_buffers = function(_) + return require("neominimap.util").get_visible_buffers() + end, }, }, - get_annotations = function(bufnr) - return require("neominimap.map.handlers.builtins.search").get_annotations(bufnr) - end, }, - mark = { - name = "Built-in Mark", - mode = config.mark.mode, - init = function() - require("neominimap.events.mark")(config.mark.key) - end, - namespace = api.nvim_create_namespace("neominimap_mark"), - autocmds = { - { - event = "BufWinEnter", - opts = { - desc = "Update mark annotations when entering window", - get_buffers = function(_) - return api.nvim_get_current_buf() - end, - }, - }, - { - event = "TabEnter", - opts = { - desc = "Update marks annotations when entering tab", - get_buffers = function(_) - return require("neominimap.util").get_visible_buffers() - end, - }, + get_annotations = function(bufnr) + return require("neominimap.map.handlers.builtins.search").get_annotations(bufnr) + end, +} + +---@type Neominimap.Map.Handler +local mark_handler = { + name = "Built-in Mark", + mode = config.mark.mode, + init = function() end, + namespace = api.nvim_create_namespace("neominimap_mark"), + autocmds = { + { + event = "BufWinEnter", + opts = { + desc = "Update mark annotations when entering window", + get_buffers = function(_) + return api.nvim_get_current_buf() + end, }, - { - event = "User", - opts = { - pattern = "Mark", - desc = "Update marks annotations when mark event is triggered", - get_buffers = function(_) - return require("neominimap.util").get_visible_buffers() - end, - }, + }, + { + event = "TabEnter", + opts = { + desc = "Update marks annotations when entering tab", + get_buffers = function(_) + return require("neominimap.util").get_visible_buffers() + end, }, }, - get_annotations = function(bufnr) - return require("neominimap.map.handlers.builtins.mark").get_annotation(bufnr) - end, }, + get_annotations = function(bufnr) + return require("neominimap.map.handlers.builtins.mark").get_annotation(bufnr) + end, +} + +if vim.fn.has("nvim-0.12") ~= 1 then + mark_handler.init = function() + require("neominimap.events.mark")(config.mark.key) + end + table.insert(mark_handler.autocmds, { + event = "User", + opts = { + pattern = "Mark", + desc = "Update marks annotations when mark event is triggered", + get_buffers = function(_) + return require("neominimap.util").get_visible_buffers() + end, + }, + }) +else + table.insert(mark_handler.autocmds, { + event = "MarkSet", + opts = { + desc = "Update marks annotations when mark event is triggered", + get_buffers = function(_) + return require("neominimap.util").get_visible_buffers() + end, + }, + }) +end + +---@type table +return { + git = git_handler, + mini_diff = mini_diff_handler, + diagnostic = diagnostic_handler, + search = search_handler, + mark = mark_handler, } From 589856a810458fdeffde2480da1151219a742975 Mon Sep 17 00:00:00 2001 From: Jiahe Jiang <61075605+Isrothy@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:15:00 +0800 Subject: [PATCH 2/3] doc: add installation guide for neovim 0.12 --- README.md | 395 +++++++++++++++-------------- lua/neominimap/config/internal.lua | 2 +- 2 files changed, 207 insertions(+), 190 deletions(-) diff --git a/README.md b/README.md index 30c9ccd..0f52c6a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,24 @@ The color scheme used for these screenshots is [nord](https://github.com/gbprod/ ## Installation +With `vim.pack`: + +```lua +vim.pack.add({ + { src = "https://github.com/Isrothy/neominimap.nvim" }, +}) + +-- The following options are recommended when layout == "float" +vim.opt.wrap = false +vim.opt.sidescrolloff = 36 -- Set a large value + +--- Put your configuration here +---@type Neominimap.UserConfig +vim.g.neominimap = { + auto_enable = true, +} +``` + With Lazy: ```lua @@ -166,230 +184,229 @@ With Lazy: ```lua ---@enum Neominimap.Handler.Annotation local AnnotationMode = { - Sign = "sign", -- Show braille signs in the sign column - Icon = "icon", -- Show icons in the sign column - Line = "line", -- Highlight the background of the line on the minimap + Sign = "sign", -- Show braille signs in the sign column + Icon = "icon", -- Show icons in the sign column + Line = "line", -- Highlight the background of the line on the minimap } vim.g.neominimap = { - -- Enable the plugin by default - auto_enable = true, ---@type boolean - - -- Log level - log_level = vim.log.levels.OFF, ---@type Neominimap.Log.Levels - - -- Notification level - notification_level = vim.log.levels.INFO, ---@type Neominimap.Log.Levels - - -- Path to the log file - log_path = vim.fn.stdpath("data") .. "/neominimap.log", ---@type string - - -- Minimaps will not be created for buffers of these filetypes - ---@type string[] - exclude_filetypes = { - "help", - "bigfile", -- For Snacks.nvim - }, - - -- Minimaps will not be created for buffers of these buftypes - ---@type string[] - exclude_buftypes = { - "nofile", - "nowrite", - "quickfix", - "terminal", - "prompt", - }, + -- Enable the plugin by default + auto_enable = true, ---@type boolean - -- When this function returns false, the minimap will not be created for this buffer. - ---@type fun(bufnr: integer): boolean - buf_filter = function() - return true - end, + -- Log level + log_level = vim.log.levels.OFF, ---@type Neominimap.Log.Levels - -- When this function returns false, the minimap will not be created for this window. - ---@type fun(winid: integer): boolean - win_filter = function() - return true - end, + -- Notification level + notification_level = vim.log.levels.INFO, ---@type Neominimap.Log.Levels - -- When this function returns false, the minimap will not be created for this tab. - ---@type fun(tabid: integer): boolean - tab_filter = function() - return true - end, + -- Path to the log file + log_path = vim.fn.stdpath("data") .. "/neominimap.log", ---@type string - -- How many columns a dot should span - x_multiplier = 4, ---@type integer + -- Minimaps will not be created for buffers of these filetypes + ---@type string[] + exclude_filetypes = { + "help", + "bigfile", -- For Snacks.nvim + }, - -- How many rows a dot should span - y_multiplier = 1, ---@type integer + -- Minimaps will not be created for buffers of these buftypes + ---@type string[] + exclude_buftypes = { + "nofile", + "nowrite", + "quickfix", + "terminal", + "prompt", + }, - ---@alias Neominimap.Config.CurrentLinePosition "center" | "percent" + -- When this function returns false, the minimap will not be created for this buffer. + ---@type fun(bufnr: integer): boolean + buf_filter = function() + return true + end, + + -- When this function returns false, the minimap will not be created for this window. + ---@type fun(winid: integer): boolean + win_filter = function() + return true + end, + + -- When this function returns false, the minimap will not be created for this tab. + ---@type fun(tabid: integer): boolean + tab_filter = function() + return true + end, + + -- How many columns a dot should span + x_multiplier = 4, ---@type integer + + -- How many rows a dot should span + y_multiplier = 1, ---@type integer + + ---@alias Neominimap.Config.CurrentLinePosition "center" | "percent" + + -- How the minimap places the current line vertically. + -- `"center"` -> pins the line to the viewport middle (window-relative). + -- `"percent"` -> maps line index / total lines to minimap height (file-relative). + -- Note: here "center" means the middle of the **minimap window**, not "center of the file". + current_line_position = "center", ---@type Neominimap.Config.CurrentLinePosition + + buffer = { + -- When true, the minimap will be recreated when you delete the buffer. + -- When false, the minimap will be disabled for the current buffer when you delete the minimap buffer. + persist = true, ---@type boolean + }, - -- How the minimap places the current line vertically. - -- `"center"` -> pins the line to the viewport middle (window-relative). - -- `"percent"` -> maps line index / total lines to minimap height (file-relative). - -- Note: here "center" means the middle of the **minimap window**, not "center of the file". - current_line_position = "center", ---@type Neominimap.Config.CurrentLinePosition + ---@alias Neominimap.Config.LayoutType "split" | "float" - buffer = { - -- When true, the minimap will be recreated when you delete the buffer. - -- When false, the minimap will be disabled for the current buffer when you delete the minimap buffer. - persist = true, ---@type boolean - }, + --- Either `split` or `float` + --- When layout is set to `float`, minimaps will be created in floating windows attached to all suitable windows. + --- When layout is set to `split`, the minimap will be created in one split window per tab. + layout = "float", ---@type Neominimap.Config.LayoutType + --- Used when `layout` is set to `split` + split = { + minimap_width = 20, ---@type integer - ---@alias Neominimap.Config.LayoutType "split" | "float" + -- Always fix the width of the split window + fix_width = false, ---@type boolean - --- Either `split` or `float` - --- When layout is set to `float`, minimaps will be created in floating windows attached to all suitable windows. - --- When layout is set to `split`, the minimap will be created in one split window per tab. - layout = "float", ---@type Neominimap.Config.LayoutType + ---@alias Neominimap.Config.SplitDirection "left" | "right" | "topleft" | "botright" | "aboveleft" | "rightbelow" + direction = "right", ---@type Neominimap.Config.SplitDirection - --- Used when `layout` is set to `split` - split = { - minimap_width = 20, ---@type integer + --- Automatically close the split window when it is the last window. + close_if_last_window = false, ---@type boolean - -- Always fix the width of the split window - fix_width = false, ---@type boolean + --- When true, the split window will be recreated when you close it. + --- When false, the minimap will be disabled for the current tab when you close the minimap window. + persist = true, ---@type boolean + }, - ---@alias Neominimap.Config.SplitDirection "left" | "right" | "topleft" | "botright" | "aboveleft" | "rightbelow" - direction = "right", ---@type Neominimap.Config.SplitDirection + --- Used when `layout` is set to `float` + float = { + minimap_width = 20, ---@type integer - --- Automatically close the split window when it is the last window. - close_if_last_window = false, ---@type boolean + --- If set to nil, there is no maximum height restriction + --- @type integer + max_minimap_height = nil, - --- When true, the split window will be recreated when you close it. - --- When false, the minimap will be disabled for the current tab when you close the minimap window. - persist = true, ---@type boolean - }, - - --- Used when `layout` is set to `float` - float = { - minimap_width = 20, ---@type integer + margin = { + right = 0, ---@type integer + top = 0, ---@type integer + bottom = 0, ---@type integer + }, + z_index = 1, ---@type integer - --- If set to nil, there is no maximum height restriction - --- @type integer - max_minimap_height = nil, + --- Border style of the floating window. + --- Accepts all usual border style options (e.g., "single", "double") + --- @type string | string[] | [string, string][] + window_border = vim.fn.has("nvim-0.11") == 1 and vim.o.winborder or "single", - margin = { - right = 0, ---@type integer - top = 0, ---@type integer - bottom = 0, ---@type integer + -- When true, the floating window will be recreated when you close it. + -- When false, the minimap will be disabled for the current tab when you close the minimap window. + persist = true, ---@type boolean }, - z_index = 1, ---@type integer - - --- Border style of the floating window. - --- Accepts all usual border style options (e.g., "single", "double") - --- @type string | string[] | [string, string][] - window_border = vim.fn.has("nvim-0.11") == 1 and vim.o.winborder or "single", - - -- When true, the floating window will be recreated when you close it. - -- When false, the minimap will be disabled for the current tab when you close the minimap window. - persist = true, ---@type boolean - }, - - -- For performance, when text changes, the minimap is refreshed after a certain delay. - -- Set the delay in milliseconds - delay = 200, ---@type integer - -- Sync the cursor position with the minimap - sync_cursor = true, ---@type boolean + -- For performance, when text changes, the minimap is refreshed after a certain delay. + -- Set the delay in milliseconds + delay = 200, ---@type integer - click = { - -- Enable mouse click on the minimap - enabled = false, ---@type boolean - -- Automatically switch focus to the minimap when clicked - auto_switch_focus = true, ---@type boolean - }, + -- Sync the cursor position with the minimap + sync_cursor = true, ---@type boolean - diagnostic = { - enabled = true, ---@type boolean - - -- Allowed formats for the `severity` filter: - -- 1. A single severity level: - -- eg: severity = vim.diagnostic.severity.WARN - -- 2. A table with a "min" and/or "max" key: - -- eg: severity = { min = vim.diagnostic.severity.WARN, max = vim.diagnostic.severity.ERROR } - -- 3. A list-like table of severity values: - -- eg: severity = { vim.diagnostic.severity.WARN, vim.diagnostic.severity.ERROR } - ---@see vim.diagnostic.severity - severity = nil, ---@type vim.diagnostic.SeverityFilter? - mode = "line", ---@type Neominimap.Handler.Annotation.Mode - priority = { - ERROR = 100, ---@type integer - WARN = 90, ---@type integer - INFO = 80, ---@type integer - HINT = 70, ---@type integer + click = { + -- Enable mouse click on the minimap + enabled = false, ---@type boolean + -- Automatically switch focus to the minimap when clicked + auto_switch_focus = true, ---@type boolean }, - icon = { - ERROR = "󰅚 ", ---@type string - WARN = "󰀪 ", ---@type string - INFO = "󰌶 ", ---@type string - HINT = " ", ---@type string + + diagnostic = { + enabled = true, ---@type boolean + + -- Allowed formats for the `severity` filter: + -- 1. A single severity level: + -- eg: severity = vim.diagnostic.severity.WARN + -- 2. A table with a "min" and/or "max" key: + -- eg: severity = { min = vim.diagnostic.severity.WARN, max = vim.diagnostic.severity.ERROR } + -- 3. A list-like table of severity values: + -- eg: severity = { vim.diagnostic.severity.WARN, vim.diagnostic.severity.ERROR } + ---@see vim.diagnostic.severity + severity = nil, ---@type vim.diagnostic.SeverityFilter? + mode = "line", ---@type Neominimap.Handler.Annotation.Mode + priority = { + ERROR = 100, ---@type integer + WARN = 90, ---@type integer + INFO = 80, ---@type integer + HINT = 70, ---@type integer + }, + icon = { + ERROR = "󰅚 ", ---@type string + WARN = "󰀪 ", ---@type string + INFO = "󰌶 ", ---@type string + HINT = " ", ---@type string + }, }, - }, - git = { - enabled = true, ---@type boolean - mode = "sign", ---@type Neominimap.Handler.Annotation.Mode - priority = 6, ---@type integer - icon = { - add = "+ ", ---@type string - change = "~ ", ---@type string - delete = "- ", ---@type string + git = { + enabled = true, ---@type boolean + mode = "sign", ---@type Neominimap.Handler.Annotation.Mode + priority = 6, ---@type integer + icon = { + add = "+ ", ---@type string + change = "~ ", ---@type string + delete = "- ", ---@type string + }, }, - }, - mini_diff = { - enabled = false, ---@type boolean - mode = "sign", ---@type Neominimap.Handler.Annotation.Mode - priority = 6, ---@type integer - icon = { - add = "+ ", ---@type string - change = "~ ", ---@type string - delete = "- ", ---@type string + mini_diff = { + enabled = false, ---@type boolean + mode = "sign", ---@type Neominimap.Handler.Annotation.Mode + priority = 6, ---@type integer + icon = { + add = "+ ", ---@type string + change = "~ ", ---@type string + delete = "- ", ---@type string + }, }, - }, - search = { - enabled = false, ---@type boolean - mode = "line", ---@type Neominimap.Handler.Annotation.Mode - priority = 20, ---@type integer - icon = "󰱽 ", ---@type string - }, + search = { + enabled = false, ---@type boolean + mode = "line", ---@type Neominimap.Handler.Annotation.Mode + priority = 20, ---@type integer + icon = "󰱽 ", ---@type string + }, - treesitter = { - enabled = true, ---@type boolean - priority = 200, ---@type integer - }, + treesitter = { + enabled = true, ---@type boolean + priority = 200, ---@type integer + }, - mark = { - enabled = false, ---@type boolean - mode = "icon", ---@type Neominimap.Handler.Annotation.Mode - priority = 10, ---@type integer - key = "m", ---@type string - show_builtins = false, ---@type boolean -- shows the builtin marks like [ ] < > - }, + mark = { + enabled = false, ---@type boolean + mode = "icon", ---@type Neominimap.Handler.Annotation.Mode + priority = 10, ---@type integer + key = "m", ---@type string -- Useless for neovim >= 0.12 + show_builtins = false, ---@type boolean -- shows the builtin marks like [ ] < > + }, - fold = { - -- Consider folds when rendering the minimap - enabled = true, ---@type boolean - }, + fold = { + -- Consider folds when rendering the minimap + enabled = true, ---@type boolean + }, - --- Override the default window options - ---@param opt vim.wo - ---@param winid integer the window id of the source window, NOT the minimap window - winopt = function(opt, winid) end, + --- Override the default window options + ---@param opt vim.wo + ---@param winid integer the window id of the source window, NOT the minimap window + winopt = function(opt, winid) end, - --- Override the default buffer options - ---@param opt vim.bo - ---@param bufnr integer the buffer id of the source buffer, NOT the minimap buffer - bufopt = function(opt, bufnr) end, + --- Override the default buffer options + ---@param opt vim.bo + ---@param bufnr integer the buffer id of the source buffer, NOT the minimap buffer + bufopt = function(opt, bufnr) end, - ---@type Neominimap.Map.Handler[] - handlers = {}, + ---@type Neominimap.Map.Handler[] + handlers = {}, } ``` @@ -766,10 +783,10 @@ Here is an example: ```lua -- Old API -require('neominimap').bufOn({}) -- Defaults to current buffer +require("neominimap").bufOn({}) -- Defaults to current buffer -- New API -require('neominimap.api').buf.enable() -- Explicitly defaults to current buffer -require('neominimap.api').buf.enable({}) -- Does nothing +require("neominimap.api").buf.enable() -- Explicitly defaults to current buffer +require("neominimap.api").buf.enable({}) -- Does nothing ``` diff --git a/lua/neominimap/config/internal.lua b/lua/neominimap/config/internal.lua index 821b49e..bfe7e63 100644 --- a/lua/neominimap/config/internal.lua +++ b/lua/neominimap/config/internal.lua @@ -196,7 +196,7 @@ local M = { enabled = false, ---@type boolean mode = "icon", ---@type Neominimap.Handler.Annotation.Mode priority = 10, ---@type integer - key = "m", ---@type string + key = "m", ---@type string -- Useless for neovim >= 0.12 show_builtins = false, ---@type boolean -- shows the builtin marks like [ ] < > }, From 7eb89769602a054917e41cff8d7c1a6d2b3b4577 Mon Sep 17 00:00:00 2001 From: Jiahe Jiang <61075605+Isrothy@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:24:33 +0800 Subject: [PATCH 3/3] feat: support events when inplicit marks are set --- lua/neominimap/map/handlers/builtins/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/neominimap/map/handlers/builtins/init.lua b/lua/neominimap/map/handlers/builtins/init.lua index 759bf81..c766534 100644 --- a/lua/neominimap/map/handlers/builtins/init.lua +++ b/lua/neominimap/map/handlers/builtins/init.lua @@ -147,6 +147,15 @@ local mark_handler = { end, }, }, + { + event = { "TextYankPost", "TextChanged", "TextChanged", "ModeChanged", "InsertLeave", "CursorMoved" }, + opts = { + desc = "Update marks annotations when inplicit marks are set", + get_buffers = function(_) + return require("neominimap.util").get_visible_buffers() + end, + }, + }, }, get_annotations = function(bufnr) return require("neominimap.map.handlers.builtins.mark").get_annotation(bufnr)