Skip to content

Cherry-pick: Fix TextEdit styles and disable clipping. - #1465

Open
JoltedJon wants to merge 1 commit into
Redot-Engine:masterfrom
JoltedJon:cherry-6
Open

JoltedJon wants to merge 1 commit into
Redot-Engine:masterfrom
JoltedJon:cherry-6

Conversation

@JoltedJon

@JoltedJon JoltedJon commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Brings in godotengine/godot#109078

Summary by CodeRabbit

  • Bug Fixes
    • Improved rendering of text editor content, minimaps, highlights, gutters, carets, and inline color swatches. Thick caret outlines and search-result borders now render more cleanly.
  • Documentation
    • Updated the TextEdit class documentation to no longer list clip_contents as a TextEdit-specific member.

Co-Authored-By: kit <kitbdev@gmail.com>
@JoltedJon
JoltedJon requested review from a team October 1, 2026 20:05
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: Redot-Engine/redot-engine/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b471e0e7-a075-4b60-89e4-64a1f1dfa7a8

📥 Commits

Reviewing files that changed from the base of the PR and between 80d31f7 and e5f824d.

📒 Files selected for processing (5)
  • doc/classes/TextEdit.xml
  • editor/script/script_text_editor.cpp
  • scene/gui/code_edit.cpp
  • scene/gui/text_edit.cpp
  • scene/gui/text_edit.h
💤 Files with no reviewable changes (1)
  • doc/classes/TextEdit.xml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

TextEdit now renders through a dedicated canvas item configured for clipping and visibility. CodeEdit and inline-object drawing use that item for their drawing operations. TextEdit also adds an unfilled-rectangle drawing helper and removes its documented clip_contents member.

Changes

Text Rendering

Layer / File(s) Summary
Canvas item setup and API
scene/gui/text_edit.h, scene/gui/text_edit.cpp, doc/classes/TextEdit.xml
TextEdit declares, creates, exposes, and frees a dedicated text canvas item. The class no longer enables control-level clipping, and its documentation no longer lists the clip_contents member.
TextEdit drawing operations
scene/gui/text_edit.h, scene/gui/text_edit.cpp
TextEdit routes its text, minimap, gutters, highlights, glyphs, carets, and IME indicators through the dedicated item. It adds a helper for drawing unfilled rectangles.
CodeEdit and inline-object drawing
scene/gui/code_edit.cpp, editor/script/script_text_editor.cpp
CodeEdit routes hints, completion UI, gutter icons, and line numbers through the text canvas item. Inline color swatches also use that item through RenderingServer.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: arctis-fireblight, generalprotectionfault

Merge Risk: ⚪ Minimal · up to e5f82

This change moves TextEdit drawing onto a dedicated canvas item that handles clipping. No concrete problems were found in review, so it looks ready to merge, subject to normal visual checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to e5f82

The change is confined to drawing and resource lifetime. No new privilege or data-access path was identified, but behavior outside the inspected callers remains unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The change affects rendering across TextEdit and CodeEdit instances and their inline-editor clients. Each TextEdit creates its own dependent RID; the inspected flow does not introduce a shared cross-owner rendering target.

Security Findings and Attack Paths

  • inferred — No introduced attack path was established in the inspected consumers. Inline-object metadata becomes drawing geometry and color, while the destination RID comes from the editor's owning TextEdit rather than from that metadata. This conclusion does not cover arbitrary external native callers.

Trust Boundaries and Controls

  • observed — Text-layer clipping remains explicitly enabled on the child item. Renderer rectangle submission checks RID ownership and rejects an invalid lookup; RID release invalidates its validator. These are counterevidence to the speculative claim that retaining this borrowed RID after destruction necessarily grants access to another owner's rendering state.

Resilience and Maintainability Implications

  • inferred — The inspected lifecycle preserves ownership through ordinary tree exit and reentry: exit detaches the control's parent canvas without freeing its RID, so the dedicated child remains dependent on that control. TextEdit destruction frees the child before base CanvasItem destruction frees the parent. Renderer cleanup removes the child from its parent and invalidates its handle. Repeated draws clear previous commands instead of accumulating them.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the main changes: fixing TextEdit rendering styles and disabling control clipping.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants