rmagatti / session-lens

A session-switcher extension for rmagatti/auto-session using Telescope.nvim
MIT License
226 stars 13 forks source link

Support multiple selection for delete session #21

Closed Aetf closed 2 years ago

Aetf commented 2 years ago

Currently <c-d> only deletes the currently highlighted item.

By using the delete_selection function, it can actually support deleting multiple sessions. This will also not close the picker.

SessionLensActions.delete_session = function(prompt_bufnr)
  local current_picker = action_state.get_current_picker(prompt_bufnr)
  current_picker:delete_selection(function(selection)
    AutoSession.DeleteSession(selection.path)
  end)
end