From 041d8e92d17b28ac7e887cd8e334d88ef4e0f569 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 21 Dec 2022 21:26:48 +0900 Subject: neovim:uniquify: shorten path if there are other paths that are exactly the same --- .config/nvim/lua/uniquify.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.config/nvim/lua/uniquify.lua') diff --git a/.config/nvim/lua/uniquify.lua b/.config/nvim/lua/uniquify.lua index b9b9d32..c7f8482 100644 --- a/.config/nvim/lua/uniquify.lua +++ b/.config/nvim/lua/uniquify.lua @@ -8,6 +8,12 @@ local stricmp = vim.stricmp function M.uniquify(this_path, other_paths) + for i = 1, #other_paths do + if other_paths[i] == this_path then + table.remove(other_paths, i) + end + end + -- Split each path into slash-separated parts. for i = 1, #other_paths do other_paths[i] = split(other_paths[i], '[\\/]') -- cgit v1.2.3-70-g09d2