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: Reflow module is convoluted and should be refactored / replaced #242

Open
joshka opened this issue Jun 11, 2023 · 0 comments
Open
Labels
Type: Enhancement New feature or request Type: RFC Request for Comment. A design doc used to gather opinions on future features

Comments

@joshka
Copy link
Member

joshka commented Jun 11, 2023

Problem

The wrapping in reflow is fairly convoluted, which makes it difficult to maintain (fix problems and add new features). This caused a problem in #193

https://github.com/tui-rs-revival/ratatui/blob/492af7a92d264a590ebbf4eb90b45657e30dfd30/src/widgets/reflow.rs#L55-L209

Solution / Constraints

  • Simplify the wrapping logic
  • Move the wrapping logic to the right place (perhaps under the text module?)
  • Implement the wrapping against a single Line to avoid having nested iterators
  • Allow the wrapping logic to be used in any widget, not just paragraph
  • Maintain backwards compatibility (allow graceful deprecation of the current methods rather than breaking all current code)
  • Spec this out before implementation (because implementing this without a spec leads to very long and painful PRs)
@joshka joshka added Type: Enhancement New feature or request Type: RFC Request for Comment. A design doc used to gather opinions on future features labels Jun 11, 2023
@joshka joshka mentioned this issue Jul 2, 2023
6 tasks
@joshka joshka changed the title Reflow module is convoluted and should be refactored / replaced Text: Reflow module is convoluted and should be refactored / replaced Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request Type: RFC Request for Comment. A design doc used to gather opinions on future features
Projects
None yet
Development

No branches or pull requests

1 participant