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

Fix choices out of bounds #9

Merged
merged 2 commits into from
Sep 3, 2012

Conversation

inkarkat
Copy link
Contributor

Hi; I hope you don't mind another set of patches; I'm currently re-purposing SwapIt for another use case, and found some more minor issues.

The index must be reset to zero. As the element is guaranteed to be inside the match list, we can simply use modulo for that.
At the first element, the index is turned into -1, the modulo operation leaves that alone, and Vim indexing accesses the last element, leading to a correct wrap-around.
mjbrownie added a commit that referenced this pull request Sep 3, 2012
@mjbrownie mjbrownie merged commit 193afaf into mjbrownie:master Sep 3, 2012
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.

2 participants