Move one step forward in the history.
(
self,
start: bool = True,
search: bool = False,
target: str | None = None,
include_current: bool = False,
)
| 125 | return 0 |
| 126 | |
| 127 | def forward( |
| 128 | self, |
| 129 | start: bool = True, |
| 130 | search: bool = False, |
| 131 | target: str | None = None, |
| 132 | include_current: bool = False, |
| 133 | ) -> str: |
| 134 | """Move one step forward in the history.""" |
| 135 | if target is None: |
| 136 | target = self.saved_line |
| 137 | if self.index > 1: |
| 138 | if search: |
| 139 | self.index -= self.find_partial_match_forward( |
| 140 | target, include_current |
| 141 | ) |
| 142 | elif start: |
| 143 | self.index -= self.find_match_forward(target, include_current) |
| 144 | else: |
| 145 | self.index -= 1 |
| 146 | return self.entry |
| 147 | else: |
| 148 | self.index = 0 |
| 149 | return self.saved_line |
| 150 | |
| 151 | def find_match_forward( |
| 152 | self, search_term: str, include_current: bool = False |