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

Columns calculation in MenuSupport is unreliable #191

Closed
tpoliaw opened this issue Nov 24, 2017 · 2 comments
Closed

Columns calculation in MenuSupport is unreliable #191

tpoliaw opened this issue Nov 24, 2017 · 2 comments

Comments

@tpoliaw
Copy link
Contributor

tpoliaw commented Nov 24, 2017

If Option.LIST_ROW_FIRST and Option.MENU_COMPLETE are both set for a LineReader, the number of columns can be calculated incorrectly in the MenuSupport instance.

In the case I've found, I have 9 completion candidates and it's splitting them onto two rows with 6 and 3 options respectively. The columns calculation assumes the minimum number of columns are used for the number of lines (giving 5 columns).

I'm not sure if the best way to handle it, either forcing the minimum number of columns without increasing the number of rows, or to return the number of columns somehow.

Let me know which you'd prefer and I'm happy to work on a PR. I have another couple in that area that I'd like to submit soonish as well.

@gnodet
Copy link
Member

gnodet commented Nov 27, 2017

I think forcing the minimum number of columns without increasing the number of rows would be the best looking option, but I don't have a strong opinion.

ghost pushed a commit to tpoliaw/jline3 that referenced this issue Nov 29, 2017
Prevents the situation where (eg) 9 completion candidates are split 6/3
instead of 5/4 and subsequent columns calculations are incorrect.

Fixes jline#191
@tpoliaw
Copy link
Contributor Author

tpoliaw commented Nov 29, 2017

I'm still not sure either way, but if you want to minimise the number of columns, I think #196 should fix it.

@gnodet gnodet closed this as completed in ed016da Dec 4, 2017
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

No branches or pull requests

2 participants