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);