Skip to content

Find with "Match Whole Word" misses valid occurrences #291591

Description

@gurs-cr

Type: Bug

  1. Copy into an empty document the following text:
    [1] aa-aa
    [2] xaa-aa-aa
    [3] aax-aa-aa

  2. Use Find (CTRL-F) to find the string aa-aa

  3. An instance of the string appear in every line. We can argue if line 2 should have 2 instances but that would be too much of nitpicking.

  4. Turn on Match whole-word for Find

  5. VScode only shows a match for lines 1 and 3 even though line 2 has a match.
    grep -w 'aa-aa' on the text would show 3 matches.

VS Code version: Code 1.108.2 (c9d7799, 2026-01-21T13:52:09.270Z)
OS version: Windows_NT x64 10.0.26200
Modes:
Remote OS version: Linux x64 5.15.0-164-generic

System Info
Item Value
CPUs AMD Ryzen AI 7 PRO 350 w/ Radeon 860M (16 x 1996)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 23.65GB (7.09GB free)
Process Argv --crash-reporter-id d029bbe8-b556-4c47-a48a-d4c25a5e1763
Screen Reader no
VM 0%
Item Value
Remote SSH: gur-vm
OS Linux x64 5.15.0-164-generic
CPUs AMD EPYC 9174F 16-Core Processor (16 x 0)
Memory (System) 62.79GB (53.00GB free)
VM 100%
Extensions (5)
Extension Author (truncated) Version
spellright ban 3.0.148
remote-ssh ms- 0.122.0
remote-ssh-edit ms- 0.87.0
remote-explorer ms- 0.5.0
cpptools ms- 1.29.3
A/B Experiments
vsliv368:30146709
pythonvspyt551cf:31249601
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31436602
aj953862:31281341
82j33506:31327384
6abeh943:31336334
cloudbuttont:31379625
aihoversummaries_t:31453032
3efgi100_wstrepl:31403338
use-responses-api:31390855
je187915:31401257
ec5jj548:31422691
cp_cls_t_966_ss:31454198
c0683394:31419495
ge8j1254_inline_auto_hint_haiku:31431912
a5gib710:31434435
5j92g670_sonnet:31446810
7a04d226_do_not_restore_last_panel_session:31438103
anthropic_thinking_t:31432745
cp_cls_c_1081:31443829
nes-set-to-on:31441941
a43f0576c:31442824

Activity

  1. added
    stale
    on Feb 5, 2026
  2. removed
    stale
    on Feb 16, 2026
  3. added
    bug
    editor-find
    on May 30, 2026
  4. dobbydobap commented on Jul 18, 2026

    @dobbydobap
    Contributor

    confirmed this, Match Whole Word is applied as a post-filter, and when a candidate fails the check the search resumes past the whole match, so an overlapping valid whole-word match that starts inside it gets skipped (the trailing aa-aa in xaa-aa-aa). opening a PR that advances by one code point instead, with a regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugeditor-find

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions