Skip to content

Fix placeholder for 0 width textinputs#951

Open
ShadiestGoat wants to merge 1 commit intocharmbracelet:mainfrom
ShadiestGoat:fix-texinput-placeholder
Open

Fix placeholder for 0 width textinputs#951
ShadiestGoat wants to merge 1 commit intocharmbracelet:mainfrom
ShadiestGoat:fix-texinput-placeholder

Conversation

@ShadiestGoat
Copy link
Copy Markdown

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features). (n/a)

Fixes #950

The issue is that the placeholder arr (p) was made using width + 1. Width = 0 (and, technically, width < 0) are valid widths indicating unlimited width. There is even a comment later in the view that makes it sound like this is the intentional behaviour:

if there is no width, the placeholder can be any length

However, if w = 0, then the p will be 1 rune in length rather than unlimited

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.

textinput v2: 0 Width breaks placeholders

1 participant