historyDown walks one step toward newer entries; -1 is the live draft sentinel and restores an empty textarea.
()
| 153 | // historyDown walks one step toward newer entries; -1 is the live draft |
| 154 | // sentinel and restores an empty textarea. |
| 155 | func (m Model) historyDown() Model { |
| 156 | if m.histIdx == -1 { |
| 157 | return m |
| 158 | } |
| 159 | m.histIdx-- |
| 160 | if m.histIdx == -1 { |
| 161 | m.ta.Restore(m.histDraft) |
| 162 | } else { |
| 163 | m.ta.Restore(m.promptHistory[len(m.promptHistory)-1-m.histIdx]) |
| 164 | } |
| 165 | return m |
| 166 | } |
| 167 | |
| 168 | // handleTab implements the three Tab behaviours: seed "/" on an empty prompt |
| 169 | // (opens the command popover), complete a unique match when the popover is |