Skip to content
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

Consider reverting #37940 #41799

Closed
timholy opened this issue Aug 6, 2021 · 5 comments · Fixed by #41835
Closed

Consider reverting #37940 #41799

timholy opened this issue Aug 6, 2021 · 5 comments · Fixed by #41835

Comments

@timholy
Copy link
Sponsor Member

timholy commented Aug 6, 2021

#37940 (comment)

@jonas-schulze
Copy link
Contributor

Would it be possible to instead move keypress further up, such that the menu is able to intercept even standard inputs? This might however introduce other failures depending on how third-party menus handle standard inputs. 😕

@timholy
Copy link
Sponsor Member Author

timholy commented Aug 7, 2021

I don't see an easy way, because if a package has already handled ' ' you wouldn't want AbstractMenu doing something else with it. keypress only returns a shouldbreak::Bool, and I think it would need a alreadyhandled::Bool to work properly. Unless you see a way?

I think this can come back (I totally get why you'd want this, it's a great feature to have), but we'd need to introduce some kind of key-configuration. It's unclear to me whether that should be a global or an option to the menu constructor. Overall, giving TerminalMenus a decent interface while also not breaking anything is a hard problem, I had to go to considerable heroics in #35915.

@jonas-schulze
Copy link
Contributor

jonas-schulze commented Aug 9, 2021

keypress only returns a shouldbreak::Bool, and I think it would need a alreadyhandled::Bool to work properly.

You are right, my suggestion wouldn't work. I made a draft for opt-in vim bindings. TreeMenu could then opt-in to only support j and k but not Space by defining:

# check for julia version here...
accepts_jk(::TreeMenu) = true

If you like, I can prepare a PR to FoldingTrees as well.

@jonas-schulze
Copy link
Contributor

FYI: The keybindings introduced in #41576 also clash with vim bindings.

@timholy
Copy link
Sponsor Member Author

timholy commented Aug 9, 2021

#41576 is completely optional so won't affect any existing users, and doesn't specify any particular keys. It merely adds the facility to customize keys. You could probably mimic that approach and add a navigation_keys keyword argument or something.

I'll go ahead and revert #37940, thanks for your willingness and the discussion! Yes, I'd be happy to receive a PR for FoldingTrees once the replacement for #37940 merges.

timholy added a commit that referenced this issue Aug 9, 2021
KristofferC pushed a commit that referenced this issue Aug 25, 2021
This reverts commit 4a19b75.
Closes #41799.

(cherry picked from commit 702cf55)
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants