if up and -(self._history_idx) < len(self._history):
if self._history_idx == 0 and self._input_buffer:
self._history += [self._input_buffer[:]]
- self.clear()
+ self._clear()
self._history_idx -= 1
self._history_idx -= 1
elif (not up) and self._history_idx < 0:
self._history_idx += 1
if self._history_idx == 0:
- self.clear()
+ self._clear()
return
else:
return
self._history_idx = 0
self.draw()
- def clear(self) -> None:
+ def _clear(self) -> None:
'Empty current content.'
self._input_buffer = ''
self.draw()
to_return = self._input_buffer[:]
if to_return:
self._history += [to_return]
- self.clear()
+ self._clear()
self.draw()
return to_return