Move one step back in the history.
(
self,
start: bool = True,
search: bool = False,
target: str | None = None,
include_current: bool = False,
)
| 75 | return self.entries[-self.index] |
| 76 | |
| 77 | def back( |
| 78 | self, |
| 79 | start: bool = True, |
| 80 | search: bool = False, |
| 81 | target: str | None = None, |
| 82 | include_current: bool = False, |
| 83 | ) -> str: |
| 84 | """Move one step back in the history.""" |
| 85 | if target is None: |
| 86 | target = self.saved_line |
| 87 | if not self.is_at_end: |
| 88 | if search: |
| 89 | self.index += self.find_partial_match_backward( |
| 90 | target, include_current |
| 91 | ) |
| 92 | elif start: |
| 93 | self.index += self.find_match_backward(target, include_current) |
| 94 | else: |
| 95 | self.index += 1 |
| 96 | return self.entry |
| 97 | |
| 98 | @property |
| 99 | def entry(self) -> str: |