1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-20 17:22:23 +03:00

Add AllowEmptyInput flag to PromptOpts

Most of our prompts don't (shouldn't) allow empty input, but most callers didn't
check, and would run into cryptic errors when the user pressed enter at an empty
prompt (e.g. when creating a new branch). Now we simply don't allow hitting
enter in this case, and show an error toast instead.

This behavior is opt-out, because there are a few cases where empty input is
supported (e.g. creating a stash).
This commit is contained in:
Stefan Haller
2025-11-15 13:05:39 +01:00
parent a7bc1012b9
commit b3435bd59c
9 changed files with 28 additions and 3 deletions

View File

@@ -130,6 +130,7 @@ func (self *WorktreeHelper) NewWorktreeCheckout(base string, canCheckoutBase boo
return f()
},
AllowEmptyInput: true,
})
return nil
@@ -147,6 +148,7 @@ func (self *WorktreeHelper) NewWorktreeCheckout(base string, canCheckoutBase boo
return f()
},
AllowEmptyInput: false,
})
return nil