Skip to content

Commit

Permalink
Omit first word in hash backwards search
Browse files Browse the repository at this point in the history
  • Loading branch information
ascandella committed Jul 25, 2016
1 parent f31682d commit b29bf62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/actions/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class CommandHash extends BaseCommand {
vimState.searchState = new SearchState(-1, vimState.cursorPosition, currentWord);

do {
vimState.cursorPosition = vimState.searchState.getNextSearchMatchPosition(vimState.cursorPosition).pos;
vimState.cursorPosition = vimState.searchState.getNextSearchMatchPosition(vimState.cursorPosition.getWordLeft()).pos;
} while (CommandStar.GetWordAtPosition(vimState.cursorPosition) !== currentWord);

return vimState;
Expand Down
7 changes: 7 additions & 0 deletions test/mode/normalModeTests/motions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@ suite("Motions in Normal Mode", () => {
end: ['|blah duh blah duh blah']
});

newTest({
title: "Can handle # already on the word",
start: ['one o|ne'],
keysPressed: '#',
end: ['|one one']
});

newTest({
title: "Can handle ##",
start: ['blah duh blah duh |blah'],
Expand Down

0 comments on commit b29bf62

Please sign in to comment.