Skip to content

fix(editor): keep line numbers and the find panel inside the editor - #3591

Merged
datlechin merged 2 commits into
mainfrom
fix/readonly-editor-gutter-clip
Oct 19, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/readonly-editor-gutter-clip

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

In a read-only code view under a toolbar, such as the EXPLAIN result in Raw mode, scrolling the text drew the line numbers of rows above the view over the toolbar. The editor's find panel slid over it the same way. Since macOS 14, NSView.clipsToBounds defaults to false. The gutter is a document-tall floating subview that AppKit places beside the clip view, and nothing between it and the window clipped it. The main query editor only escaped because its host clips.

Change

  • The editor's outermost view now clips to its bounds. This keeps the gutter, the fold and run ribbons, and the find panel inside the editor in every host: EXPLAIN Raw, object source, structure DDL, Compare, the trigger editor and the JSON viewers.
  • The gutter's hover tracking and the ribbons' accessibility elements now stop at the editor's edge too.

Verified

TextViewControllerClippingTests fails on main (3 of 3) and passes here. All 739 TableProEditor package tests pass. Checked in a Debug build against PostgreSQL.

Screenshots

Dark Light
Before Before, dark Before, light
After After, dark After, light

Not in this PR

  • DDLTextView, SQLCodePreview and TriggerEditorView keep the old Code folding setting until their font or the theme changes.

On macOS 14 and later nothing below the editor's root view clipped, so the
document-tall gutter painted line numbers of rows scrolled out of view over
the view above it, and the find panel slid over it too. Clip the find view
controller's view, the editor's outermost view.
@datlechin
datlechin merged commit e654263 into main Oct 19, 2026
17 checks passed
@datlechin
datlechin deleted the fix/readonly-editor-gutter-clip branch October 19, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant