fix: CharLimit <= 0 should be ignored

This commit is contained in:
Maas Lalani 2022-08-04 14:47:09 -04:00
parent 8f65160828
commit 84eacf535a

View File

@ -797,7 +797,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
case key.Matches(msg, m.KeyMap.WordBackward):
m.wordLeft()
default:
if rw.StringWidth(m.Value()) >= m.CharLimit {
if m.CharLimit > 0 && rw.StringWidth(m.Value()) >= m.CharLimit {
break
}