from pick import Picker
class _PickerWithPreselection(Picker):
def __init__(self, options, initial_selection=None, **kwargs):
super().__init__(options, **kwargs)
if initial_selection is not None:
self.all_selected = sorted(
set(i for i in initial_selection if isinstance(i, int) and 0 <= i < len(options)))
if self.all_selected and kwargs.get('default_index') is None:
self.index = self.all_selected[0]
Is that something you'd want to integrate with pick?
Hi, thanks for sharing
pick
as software libre! :pray:In my scenario I need to pre-select some options, primarily for multi-select mode. What I currently do at git-delete-merged-branches is this:
Is that something you'd want to integrate with
pick
?Best, Sebastian