WithReadOnly disables the editor so no new messages can be composed.
()
| 174 | |
| 175 | // WithReadOnly disables the editor so no new messages can be composed. |
| 176 | func WithReadOnly() Option { |
| 177 | return func(e *editor) { |
| 178 | e.textarea.Placeholder = "Session is read-only" |
| 179 | e.textarea.KeyMap.InsertNewline.SetEnabled(false) |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | // defaultPlaceholder is shown in an empty editor unless WithPlaceholder |
| 184 | // overrides it. |