Skip to content

fix: keep find view zone visible so Find does not cover text#326480

Open
cipheraxat wants to merge 3 commits into
microsoft:mainfrom
cipheraxat:fix/316054-find-view-zone-space
Open

fix: keep find view zone visible so Find does not cover text#326480
cipheraxat wants to merge 3 commits into
microsoft:mainfrom
cipheraxat:fix/316054-find-view-zone-space

Conversation

@cipheraxat

Copy link
Copy Markdown
Contributor

Summary

  • Always keep the find widget's top view zone in the viewport when Find opens (adjustScroll=false), instead of often scrolling past it when the selection was not under the find box.
  • Reattach the view zone after model/view swaps (the zone id was cleared but never restored while Find stayed open).
  • Size the zone from the laid-out widget height (with a safe minimum) so first reveal cannot create an empty zone.

Fixes #316054

Test plan

  • Positive: editor.find.addExtraSpaceOnTop: true → Cmd/Ctrl+F → first line sits below the find overlay (view zone height ~37px, scrollTop 0)
  • Positive: with Find open, switch to another file in the same group (model swap) → view zone remains attached
  • Negative: editor.find.addExtraSpaceOnTop: false → no top view zone (zoneCount: 0)
  • Logic cases in screenshots/316054/ documenting old adjustScroll=true cover vs fixed path

The find widget sometimes left the first editor lines under the overlay
because revealing often scrolled past the newly added top view zone, and
model swaps cleared the zone id without reattaching it. Always keep the
zone in the viewport when Find is open, reattach after model changes, and
size the zone from the laid-out widget height.

Fixes microsoft#316054
Copilot AI review requested due to automatic review settings July 18, 2026 21:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Find widget’s top view zone so it consistently prevents the overlay from covering editor content.

Changes:

  • Reattaches the view zone after model swaps.
  • Keeps the zone visible when Find opens.
  • Uses the laid-out widget height with a safe minimum.

Comment thread src/vs/editor/contrib/find/browser/findWidget.ts
Comment thread src/vs/editor/contrib/find/browser/findWidget.ts Outdated
Comment thread src/vs/editor/contrib/find/browser/findWidget.ts Outdated
Comment thread src/vs/editor/contrib/find/browser/findWidget.ts Outdated
Comment thread src/vs/editor/contrib/find/browser/findWidget.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search box sometimes covers text being edited (fails to shift editor contents down)

3 participants