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

Swap count #11

Merged
merged 3 commits into from
Oct 6, 2013
Merged

Swap count #11

merged 3 commits into from
Oct 6, 2013

Conversation

inkarkat
Copy link
Contributor

@inkarkat inkarkat commented Oct 4, 2013

This extends the support of [count] to the swaps itself (i.e. one can skip B from A to C with 2<C-a>).

Additionally, I've avoided overriding the position of the 'a mark and the use of the "s temporary register, and added some minor tweaks for robustness.

So far, it was only passed through to the fallback. To read the count for the visual mode mappings, we use a new s:GetSelection() function instead of "dy, which has the nice side effect that it doesn't clobber the register.
Apply the same save-and-restore idiom introduced with s:GetSelection() and replace the "s temp register use with it. The :finally block also fixes an early return that failed to restore the register.
In Vim 7.2 and higher, the '" mark can be used instead. It is far less likely to disrupt the user's operation.
mjbrownie added a commit that referenced this pull request Oct 6, 2013
Swap count added - thanks inkarkat
@mjbrownie mjbrownie merged commit 81094d5 into mjbrownie:master Oct 6, 2013
@inkarkat inkarkat deleted the swap-count branch February 16, 2016 15:45
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