-
Notifications
You must be signed in to change notification settings - Fork 358
[AlecAivazis/survey#96] add support for tab completion on input #304
[AlecAivazis/survey#96] add support for tab completion on input #304
Conversation
d77c260
to
ee6c409
Compare
i will create a new section similar to "filtering options" on how to use the new feature. but the code i think is done |
7f1920a
to
5ac2b87
Compare
* tab for complete (and complete the completion) * arrows to navigate between suggestions * cancel last suggestion to typed answer * keeping previous scenarios intact
a26a157
to
3b732c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took so long for me to pull this down and take a serious look at it. Life was insanely busy but I found some time.
So in general, I LOVE this feature. On top of the killer feature, you took all of the time to add all of the different bits to get this through - awesome!
I've run it on cmd.exe and the ubuntu subsystem on windows and it runs like a charm. One minor request - can you make tab cycle to the next item (as well as down arrow)? This reflects the way that screen readers interact with consoles so we can be more accesible.
thank you @AlecAivazis, i am glad you liked it. i implemented the tab to go to next item for the suggestions now. i also realized the select and multiselect does not have this behavior and will implement on then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for adding that! I think this is finally good to go. Sorry again it took so long!
@lucassabreu this PR seems to have broken the ability for the user to use arrow keys in order to navigate the input string :( I'd like to bring that functionality back, do you mind giving it a shot? If not, I can try to find some time |
hi @AlecAivazis , I can look into it, but can you explain how to reproduce it? is just about moving the cursor on the input? |
awesome! If you run any of the tests in |
The issue is because input calls RuneReader.ReadRune instead of ReadLine which handles new characters inserted at arbitrary places in the input. |
I tried to sneak in some time this morning to get started on this but have to get back to work and might not have time to see it through to the end for a little. Here is my branch if you want to take a look (feel free to ignore it entirely if you have a better approach). The input and help tests work but I haven't tried adding any suggestions yet. We probably want to add an example with suggestions to the test suite so we can ensure the functionality stays. |
right i will try to continue from the branch. i think i left some tests... but will try to add more if needed. |
Thanks for picking this up! I really appreciate it |
trying to fix in the pr #361 |
related to #96