MCPcopy Index your code
hub / github.com/bpython/bpython / find_match_backward

Method find_match_backward

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

Source from the content-addressed store, hash-verified

105 return list(chain((self.saved_line,), reversed(self.entries)))
106
107 def find_match_backward(
108 self, search_term: str, include_current: bool = False
109 ) -> int:
110 add = 0 if include_current else 1
111 start = self.index + add
112 for idx, val in enumerate(islice(self.entries_by_index, start, None)):
113 if val.startswith(search_term):
114 return idx + add
115 return 0
116
117 def find_partial_match_backward(
118 self, search_term: str, include_current: bool = False

Callers 1

backMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected