vrapper/vrapper — pull request #36 by keforbes (2012-01-08 06:13:00+00:00)
Title: Fix for c2w defect

My fix for 'cw' on a single character word broke the behavior for 'c2w'. There are now unit tests for both the 'cw on single character word' and 'c2w' features. With this commit, all unit tests pass. It looks good to me, but I'm submitting this as a Pull Request in case someone has a cleaner solution.

Change operations typically stop at the end of a word. This is determined by the shouldStopAtLeftBoundingChar method. However, if we are performing a change operation with counts, we only want to stop at the left bounding char of the *last* word. Otherwise, stopping at the first word's left bounding char will count the next whitespace character as a word rather than jumping to the beginning of the next actual word. I made a quick and dirty change such that if there are more count operations to come, don't ever stop at the left bounding char.

The one thing I don't like about this fix is that modifying MoveWithBounds required me to update the method arguments for MoveLeftWithBounds even though that class works just fine. If no one has any problems with that, I'll probably just accept this Pull Request as is.