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

Fixed backward search from end of word (VSCodeVim #4266) #4294

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/state/searchState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export class SearchState {
.slice(0)
.reverse()
.entries()) {
if (matchRange.start.compareTo(startPosition) < 0) {
if (matchRange.end.compareTo(startPosition) <= 0) {
return {
start: Position.FromVSCodePosition(matchRange.start),
end: Position.FromVSCodePosition(matchRange.end),
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 @@ -312,6 +312,13 @@ suite('Motions in Normal Mode', () => {
end: ['one two |two two'],
});

newTest({
title: 'Can run a forward and find previous search from end of word',
start: ['|one two one two'],
keysPressed: '/two/e\nN',
end: ['one two one tw|o'],
});

// These "remembering history between editor" tests have started
// breaking. Since I don't remember these tests ever breaking for real, and
// because they're the cause of a lot of flaky tests, I'm disabling these for
Expand Down