-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable multi-select #124
base: master
Are you sure you want to change the base?
Enable multi-select #124
Conversation
Nice work! I only want to point out that |
Ahhh, the tyranny of control flow. Admittedly, I forgot about this
anti-feature as I haven't personally run into it in quite some time.
You're right of course that Ctrl-s will not work while control flow is
still enabled by default in most terminals/shells. Some other
alternative bindings I considered are Ctrl-t, Ctrl-f, and Ctrl-Space.
Of these I think I would prefer Ctrl-t because it has the mnemonic of
"tag". Any thoughts here?
…On Tue, 15 Oct 2019 at 01:24:37 PM +0000, Maxim Baz wrote:
Nice work! I only want to point out that `Ctrl-s` is an unfortunate shortcut, because pressing `Ctrl-s` makes my terminal hang (and requires pressing `Ctrl-q` to unblock it). While searching for what's going on I discovered that running `stty -ixon` disables the "hang" functionality and therefore allows `fzy` to intercept and react on pressing `Ctrl-s`, but given that many people would probably stumble upon this issue as well, maybe we can choose a more "friendly" default shortcut.
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#124 (comment)
|
I would probably vote for Have you considered moving the selection down when you press the "select" shortcut? So that when you run |
Here's a small bug I discovered:
|
I'm not able to reproduce this - are you up-to-date on the `multiselect`
branch of my fork? I did make some updates after my initial commit, some
of which addressed a few memory-related bugs.
…On Tue, 15 Oct 2019 at 07:14:58 AM -0700, Maxim Baz wrote:
Here's a small bug I discovered:
1. Run `echo 'a\nb\nc\nd' | ./fzy`
1. Type `aa<Ctrl-Space><Backspace><Enter>
```
[1] 566797 done echo 'a\nb\nc\nd' |
566798 segmentation fault (core dumped) ./fzy
```
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#124 (comment)
|
I was on |
What is printed for you in this case, |
1. I enter `aa` as the search query, so that there are no choices
available that match the query
2. I press the multi-select key
3. I press `<Backspace>` so that the query is now simply `a`. The `a`
choice reappears
4. I press `<Enter>` and `a` is returned (that being the only choice)
…On Tue, 15 Oct 2019 at 07:22:20 AM -0700, Maxim Baz wrote:
What is printed for you in this case, `aa`?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#124 (comment)
|
Thanks, with the latest code everything works well now, and I love how Great job! |
Default multi-select key is Ctrl+s
Allocate memory for the multiselect buffer in chunks, similar to how the `choices` buffer is resized. This results in potentially more unused (i.e. wasted) memory, but in fewer invocations of `malloc`/`realloc`, which is probably more important, considering the size of the multiselect array will never be that large.
29b7f3e
to
fca0904
Compare
This comment has been minimized.
This comment has been minimized.
Any update on when/if this will be pushed into master? This is a great feature. |
Why was C-t chosen over the tab key (what fzf uses)? |
Using Tab would cause a conflict because it is bound to replace the current search string with the selected item. |
This enables multi-select in
fzy
with the Ctrl+t key. PressingCtrl+t
on an item will make that item bold. PressingCtrl+t
will de-select it. When at least one item is multi-selected, pressing theReturn
key will print each multi-selected item on its own line tostdout
(this mimics the behavior offzf
's multi-select feature).EDIT: Updated the key binding to
Ctrl+t
.