aisk / pick

create curses based interactive selection list in the terminal
MIT License
722 stars 61 forks source link

Support initial selection (fixes #37) #38

Closed hartwork closed 3 years ago

hartwork commented 4 years ago

Fixes #37

hartwork commented 4 years ago

@wong2 what do you think?

wong2 commented 4 years ago

I think default_index and initial_selection is a bit confusing, they control the default behavior for single-mode and multiple-mode

wong2 commented 4 years ago

perhaps we should first move multiple picks to a separate function pick_multi?

hartwork commented 4 years ago

I think default_index and initial_selection is a bit confusing, they control the default behavior for single-mode and multiple-mode

For multiple-mode, the two are perfectly disjoint (so we cannot resolve default_index, at least not without losing a feature). The reason they overlap for single-mode is caused by get_selectedin a way because it only cares about cursor position. Maybe single-mode should become more like multiple-mode internally: use all_selected as well and put self.index into that list. Just an idea.

perhaps we should first move multiple picks to a separate function pick_multi?

No objections. Since I'm not a strong proponent of that idea I suggest that you split them up and then I rebase this pull request here on top so that you have full control of the split and I buy staying closer to what I care about with fixing Git conflicts. What do you think?

wong2 commented 4 years ago

Yeah I'll do that, but please wait for a few days

hartwork commented 4 years ago

Okay, see you in a few days :+1:

hartwork commented 3 years ago

@wong2 it's been a while, any news?

hartwork commented 3 years ago

Closing because of no reply and lost interest