MCPcopy Create free account
hub / github.com/bpython/bpython / find_match_forward

Method find_match_forward

bpython/history.py:151–160  ·  view source on GitHub ↗
(
        self, search_term: str, include_current: bool = False
    )

Source from the content-addressed store, hash-verified

149 return self.saved_line
150
151 def find_match_forward(
152 self, search_term: str, include_current: bool = False
153 ) -> int:
154 add = 0 if include_current else 1
155 end = max(0, self.index - (1 - add))
156 for idx in range(end):
157 val = self.entries_by_index[end - 1 - idx]
158 if val.startswith(search_term):
159 return idx + (0 if include_current else 1)
160 return self.index
161
162 def find_partial_match_forward(
163 self, search_term: str, include_current: bool = False

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected