prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Feature request: Word wrapping in buffers
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I need to display a longer piece of text in my full screen program. According to the docstrings FormattedTextControl/Label is only suitable for shorter strings, so I went with Buffer/BufferControl, specifically the approach in #711 (for formatted buffer).
However neither that, nor the basic underlying buffer seems to support word wrapping (wrapping on space). Instead they wrap in the middle of words.
Either I'm missing something (in which case please inform me), or this is a feature request to support basic word wrapping.
I'm not asking for hyphenation, but it would be a nice bonus if this was implemented as a wrapping-policy. Then the user could provide a fancy version specific to their natural language of choice.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the docstrings for Buffer, BufferControl, FormattedTextControl, and Label, then compare the formatted-buffer approach referenced in #711 with the current wrapping behavior. Confirm where Buffer and BufferControl split lines, and define completion as wrapping at spaces with a user-selectable wrapping policy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100