Fix XMonad.Prompt wraparound when maxComplRows not Nothing #217 #291
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When tabbing through the prompt list of completions, if the list of completions does not fit due to
maxComplRows
, without this fix an exception would be thrown. I am not certain why, but this exception occurs due to a pattern mismatch at https://github.com/mgsloan/xmonad-contrib/blob/dda242a4597c1ed0fa895a10b9296dcc709f4937/XMonad/Prompt.hs#L919However, the root cause appears to be in the
nextComplIndex
function. The problem is that it was assuming that dividing the total item count by the number of rows would yield the number of columns. This did not hold when the number of rows was being limited.Checklist
I've read CONTRIBUTING.md
I tested my changes with xmonad-testing
I updated the
CHANGES.md
file