Skip to content

Commit

Permalink
fixes #998
Browse files Browse the repository at this point in the history
  • Loading branch information
xconverge authored and rebornix committed Oct 27, 2016
1 parent d342901 commit 1300362
Show file tree
Hide file tree
Showing 2 changed files with 15 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 @@ -1512,7 +1512,7 @@ class CommandHash extends BaseCommand {
// 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;
vimState.cursorPosition = vimState.searchState.getNextSearchMatchPosition(vimState.cursorPosition.getWordLeft(true)).pos;
} while (TextEditor.getWord(vimState.cursorPosition) !== currentWord);

return vimState;
Expand Down
14 changes: 14 additions & 0 deletions test/mode/modeNormal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1349,4 +1349,18 @@ suite("Mode Normal", () => {
keysPressed: '<Esc>',
end: ['te|st'],
});

newTest({
title: "Can handle # on consecutive words",
start: ['test test test test |test'],
keysPressed: '#',
end: ['test test test |test test'],
});

newTest({
title: "Can handle # on skipped words",
start: ['test aaa test aaa test aaa test aaa |test'],
keysPressed: '#',
end: ['test aaa test aaa test aaa |test aaa test'],
});
});

0 comments on commit 1300362

Please sign in to comment.