Skip to content

Selecting text highlighting in large files silently drops highlighting of occurrences #173983

Open

Description

@mjbvz

Type: Bug

  1. In a large text file with many occurances of the same text (example: tsFsLog.txt)
  2. Go to the bottom of the file and select a common string (node_modules in my example)

Bug
Occurrences at the top are highlighted but occurrences of the same text lower in the file, including in the current view area, are not. There is no feedback about these highlights being dropped

Screenshot 2023-02-09 at 10 59 42 AM

VS Code version: Code - Insiders 1.76.0-insider (Universal) (853b32b, 2023-02-09T05:23:48.935Z)
OS version: Darwin x64 22.3.0
Modes:
Sandboxed: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 2, 3, 3
Memory (System) 32.00GB (0.54GB free)
Process Argv --crash-reporter-id 48781ca2-1705-4f64-9bab-325055aab55d
Screen Reader no
VM 0%

Activity

  1. changed the title [-]Selecting text highlighting in large files does silently drops highlighting[/-] [+]Selecting text highlighting in large files silently drops highlighting of occurrences[/+] on Feb 9, 2023
  2. alexdima commented on Feb 25, 2023

    @alexdima
    Member

    We have a limit of 1000 selection highlights for performance reasons. The selection highlights are not explicitly triggered like e.g. find results and there is always the high likelihood of having very many, like for example when selecting the letter a in a very large document.

  3. added
    feature-request
    editor-highlight
    on Feb 25, 2023
  4. JBES commented on Dec 18, 2025

    @JBES

    We have a limit of 1000 selection highlights for performance reasons. The selection highlights are not explicitly triggered like e.g. find results and there is always the high likelihood of having very many, like for example when selecting the letter a in a very large document.

    However, as mentioned in the bug report marked as duplicate, when performing a CTRL-F search there is no problem whatsoever highlighting all matches throughout the entire file no matter how large. It appears this limit has been erroneously and superfluously implemented and needs removing. Files can easily contain thousands of lines and highlighting is extremely necessary.
    Coming up to 3 years with this bug...

  5. RedCMD commented on Dec 29, 2025

    @RedCMD
    Contributor

    const LIMIT_FIND_COUNT = 999;

    this._cachedFindMatches = this._model.findMatches(this._searchText, true, false, this._matchCase, this._wordSeparators, false).map(m => m.range);

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

Metadata

Metadata

Labels

editor-highlightfeature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions