Merge pull request #710 from peco/fix-len-check-style

Use idiomatic empty string check
This commit is contained in:
lestrrat 2026-02-18 16:02:41 +09:00 committed by GitHub
commit a01c747f02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,7 +98,7 @@ func (as AnchorSettings) AnchorPosition() int {
// NewUserPrompt creates a new UserPrompt struct
func NewUserPrompt(screen Screen, anchor VerticalAnchor, anchorOffset int, prompt string, styles *StyleSet) (*UserPrompt, error) {
if len(prompt) <= 0 { // default
if prompt == "" { // default
prompt = DefaultPrompt
}
promptLen := runewidth.StringWidth(prompt)