From 666736f87f9618e95c0584406f531fa3d5f18557 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Sun, 26 Jan 2025 20:34:25 +0100 Subject: [PATCH] nvim: only list unique entries in mini.projects --- home/common/nvim/mini.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/home/common/nvim/mini.lua b/home/common/nvim/mini.lua index 947528f..339c471 100644 --- a/home/common/nvim/mini.lua +++ b/home/common/nvim/mini.lua @@ -58,7 +58,7 @@ end require('mini.pick').setup({ mappings = { move_down = '', - move_up = '', + move_up = '', toggle_info = '', toggle_preview = '', }, @@ -84,14 +84,18 @@ MiniPick.registry.projects = function(local_opts) local postprocess = function(paths) local result = {} + local seen = {} for _, path in ipairs(paths) do path = path:gsub("%/.jj/repo/store/type$", "") path = path:gsub("%/.git/HEAD$", "") - local item = { - path = path, - text = path:gsub("%" .. root .. "/", " "), - } - table.insert(result, item) + if not seen[path] then + local item = { + path = path, + text = path:gsub("%" .. root .. "/", " "), + } + table.insert(result, item) + seen[path] = true + end end return result end