Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Editor Placeholder #356

Merged
merged 2 commits into from
Mar 8, 2024
Merged

Text Editor Placeholder #356

merged 2 commits into from
Mar 8, 2024

Conversation

MinusGix
Copy link
Member

@MinusGix MinusGix commented Mar 8, 2024

Improves #341

This PR does two things

  • makes phantom text aware of which editor it is in, which was desirable anyway
    • Removes EditorTextProv as if it needs to the full Editor to pass to phantom text functions then it doesn't need to be a separate structure
    • Makes TextLayoutProvider::text return Rope rather than &Rope which I'd been thinking about anyway as Rope is cheaply cloneable
  • Adds placeholder support to the inbuilt TextEditor widget
    • this uses the Dim color by, should it use a new/different color? It does look a bit too dark on the dark theme

(I implemented this on TextDocument (so it can be used via TextEditor easily) rather than making it a general Editor feature as Editor provides the general tool of phantom text to make placeholder easy, which keeps the Editor simpler.)

Of course this also gets us closer to being able to swap out the text_input so they use the same code.

@dzhou121 dzhou121 merged commit 36ef119 into lapce:main Mar 8, 2024
7 checks passed
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.

2 participants