prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Float xcursor/ycursor
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
I think I understand the usage of (x|y)cursor in Float that are after used here in write_to_screen, do you think it could be a better/simpler idea to have a singleton cursor_pos = object() (or even a specific string "cursor") that could could be use for Floats top/left/bottom/right arguments ?
The advantage of the Cursor singleton object is you could implement __add__/__sub__ dunder,
And do things like:
from prompt_toolkit.shortcut import cursor as c
Float(left=c+1, top=c-3)
Thoughts?
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 prompt_toolkit/layout/containers.py around lines 276-381, where Float cursor positioning is used in write_to_screen. Compare the current xcursor/ycursor arguments with the proposed cursor singleton and arithmetic API; the issue needs a decided design and corresponding scope before implementation can be considered complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100