Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #998 #1001

Merged
merged 1 commit into from
Oct 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'],
});
});