From 2ae3f8813f397c9b7c839906bc0d9753ebeb2907 Mon Sep 17 00:00:00 2001 From: Aiden Scandella Date: Sun, 24 Jul 2016 23:39:14 -0700 Subject: [PATCH] Add comments --- src/actions/actions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actions/actions.ts b/src/actions/actions.ts index 758ed76c298..09eaf2c5271 100644 --- a/src/actions/actions.ts +++ b/src/actions/actions.ts @@ -519,6 +519,9 @@ class CommandHash extends BaseCommand { vimState.searchState = new SearchState(-1, vimState.cursorPosition, currentWord); do { + // use getWordLeft() on position to start at the beginning of the word. + // this ensures that any matches happen ounside of the word currently selected, + // which are the desired semantics for this motion. vimState.cursorPosition = vimState.searchState.getNextSearchMatchPosition(vimState.cursorPosition.getWordLeft()).pos; } while (CommandStar.GetWordAtPosition(vimState.cursorPosition) !== currentWord);