Neovim quick file switcher

fix: Prevent duplicates

Changed files
+8 -1
lua
javelin
+8 -1
lua/javelin/data.lua
··· 70 70 ---@param path string 71 71 local function add_path(root_path, path) 72 72 local list = Data.get_list(root_path) 73 - table.insert(list, normalize_path(root_path, vim.fn.fnamemodify(path, ":~"))) 73 + path = normalize_path(root_path, vim.fn.fnamemodify(path, ":~")) 74 + 75 + if vim.tbl_contains(list, path) then 76 + log.warn("File already in list: " .. path) 77 + return 78 + end 79 + 80 + table.insert(list, path) 74 81 write(root_path) 75 82 end 76 83