diff --git a/src/actions/commands/search.ts b/src/actions/commands/search.ts index 29b7ef1cf..34baa0186 100644 --- a/src/actions/commands/search.ts +++ b/src/actions/commands/search.ts @@ -99,7 +99,7 @@ async function createSearchStateAndMoveToMatch(args: { return; } - const escapedNeedle = escapeRegExp(needle).replace('/', '\\/'); + const escapedNeedle = escapeRegExp(needle).replaceAll('/', '\\/'); const searchString = isExact ? `\\<${escapedNeedle}\\>` : escapedNeedle; // Start a search for the given term. diff --git a/test/mode/modeVisual.test.ts b/test/mode/modeVisual.test.ts index d0175f67d..591be3a3d 100644 --- a/test/mode/modeVisual.test.ts +++ b/test/mode/modeVisual.test.ts @@ -1088,9 +1088,9 @@ suite('Mode Visual', () => { newTest({ title: '`*` escapes `/` properly', - start: ['one |two/three four', 'one two/three four'], + start: ['one |two//three four', 'one two//three four'], keysPressed: 'vE*', - end: ['one two/three four', 'one |two/three four'], + end: ['one two//three four', 'one |two//three four'], endMode: Mode.Normal, });