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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugin/swapit.vim
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ fun! ShowSwapChoices(match_list, cur_word, direction, is_visual)

"Generate the prompt {{{3
for swap_list in a:match_list
let next_index = (index(swap_list['options'], a:cur_word) + (a:direction == 'forward' ? 1 : -1)) % len(swap_list['options'])
let confirm_options = confirm_options . ' ' . a_opts[con_index] . " . " . swap_list['name'] . ' (' .
\a:cur_word . ' > ' . swap_list['options'][index(swap_list['options'], a:cur_word) + 1] . ') '
\a:cur_word . ' > ' . swap_list['options'][next_index] . ') '

" For some reason concatenating stuffs up the string, using an
" if con_index > 0
Expand Down