()
| 24 | type OpenFileWriteMsg struct{ Id int } |
| 25 | |
| 26 | func (f *FileInput) OpenFile() tea.Cmd { |
| 27 | switch f.mode { |
| 28 | case ReadMode: |
| 29 | return func() tea.Msg { |
| 30 | return OpenFileReadMsg{f.id} |
| 31 | } |
| 32 | case WriteMode: |
| 33 | return func() tea.Msg { |
| 34 | return OpenFileWriteMsg{f.id} |
| 35 | } |
| 36 | } |
| 37 | return nil |
| 38 | } |
| 39 | |
| 40 | func (f *FileInput) SetTitle(s string) { |
| 41 | f.widget.Prompt = s |