Skip to content

input: Expose the editor display map instead of a row count wrapper - #3495

Merged
huacnlee merged 1 commit into
mainfrom
fix/editor-display-map
Oct 13, 2026
Merged

huacnlee merged 1 commit into
mainfrom
fix/editor-display-map

Conversation

@huacnlee

Copy link
Copy Markdown
Member

Summary

Replace the EditorState::wrap_row_count wrapper added in #3483 with read-only access to the existing DisplayMap API. Callers query wrapped rows through state.display_map().wrap_row_count(); prewrap continues to coordinate initialization before the first layout.

Update the existing prewrap tests and both English and Chinese Editor docs. The sizing examples now use the theme monospace family and size to match the actual Editor rendering.

Public API

gpui-base (re-exported by gpui-component)

  • Added EditorState::display_map(&self) -> &DisplayMap: read-only access to wrapped-row counts and display-position queries.
  • Removed EditorState::wrap_row_count(&self) -> usize: use the existing DisplayMap query through the accessor instead.

Breaking Changes

The EditorState row-count wrapper introduced in #3483 is removed:

-let rows = editor.read(cx).wrap_row_count();
+let rows = editor.read(cx).display_map().wrap_row_count();

Test Plan

  • Passed cargo fmt --check.
  • Passed cargo check -p gpui-base.
  • Passed git diff --check.
  • Tests were not run, per repository configuration; existing prewrap tests have been updated to use the accessor.

AI-assisted: implemented with Codex.

@huacnlee
huacnlee merged commit 9fdc9d7 into main Oct 13, 2026
16 checks passed
@huacnlee
huacnlee deleted the fix/editor-display-map branch October 13, 2026 14:09
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