diff --git a/lua/telescope/_extensions/marks.lua b/lua/telescope/_extensions/marks.lua index bc70029..810ecc6 100644 --- a/lua/telescope/_extensions/marks.lua +++ b/lua/telescope/_extensions/marks.lua @@ -54,7 +54,7 @@ end local delete_harpoon_mark = function(prompt_bufnr) local confirmation = vim.fn.input( - string.format("Delete current mark? [y/n]: ") + string.format("Delete current mark(s)? [y/n]: ") ) if string.len(confirmation) == 0 @@ -63,20 +63,22 @@ local delete_harpoon_mark = function(prompt_bufnr) print(string.format("Didn't delete mark")) return end + local selection = action_state.get_selected_entry() harpoon_mark.rm_file(selection.filename) - local current_picker = action_state.get_current_picker(prompt_bufnr) - current_picker:refresh(generate_new_finder(), { reset_prompt = true }) -end -local move_mark_up = function(prompt_bufnr) - local selection = action_state.get_selected_entry() - if harpoon_mark.get_length() == selection.index then - return + local function get_selections() + local results = {} + action_utils.map_selections(prompt_bufnr, function(entry) + table.insert(results, entry) + end) + return results end - local mark_list = harpoon.get_mark_config().marks - table.remove(mark_list, selection.index) - table.insert(mark_list, selection.index + 1, selection.value) + local selections = get_selections() + for _, selection in ipairs(selections) do + harpoon_mark.rm_file(selection.filename) + end + local current_picker = action_state.get_current_picker(prompt_bufnr) current_picker:refresh(generate_new_finder(), { reset_prompt = true }) end