Skip to content

Conversation

@vemv
Copy link
Member

@vemv vemv commented Oct 6, 2023

Context

When using completion for Java interop, one normally browses the options by repeatedly pressing <down> or <up>.

However, if one completion is ambiguous (as for its Java class) we will perform a completing-read. Sample:

image

This completing-read breaks the user flow. Say I want to press <down>, <down> (go two candidates down). Then after the first candidate, the completing-read will interrupt the experience.

One can only exit this pressing RET (to choose an arbitrary one) or C-g. Both require excessive awareness of what's going on and how to remediate it.

Also, ambiguity happens quite often, so requiring users to press <down>, RET once for each ambigious candidate is a pretty irritating experience.

Proposed solution

Temporarily redefine the up and down keys to mean 'abort'. This way, completion can proceed.

Only ido-mode is affected. Other modes can be tackled in a future.

I've tried this and it works as intended.

Cheers - V

@vemv
Copy link
Member Author

vemv commented Oct 6, 2023

Reflecting a bit, while this works, perhaps it's excessively risky to modify things just for a single combination (Company + IDO).

Maybe we can provide the primitives, and document in https://docs.cider.mx/cider/usage/code_completion.html#auto-completion how to wire them up (or write your own, if needed?)

@bbatsov
Copy link
Member

bbatsov commented Oct 7, 2023

I agree - it's best to leave this to the users to do it if they want to. It's generally not a good idea to optimize for any particular tool, and a combination of tools is even worse IMO.

@vemv vemv force-pushed the with-temporary-ido-keys branch from 3116b64 to 7deea8b Compare October 8, 2023 21:14
@vemv
Copy link
Member Author

vemv commented Oct 8, 2023

Refactored

@vemv
Copy link
Member Author

vemv commented Oct 8, 2023

Thanks!

@vemv vemv merged commit 604ffac into master Oct 8, 2023
@vemv vemv deleted the with-temporary-ido-keys branch October 8, 2023 21:24
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 this pull request may close these issues.

3 participants