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

Method back

bpython/history.py:77–96  ·  view source on GitHub ↗

Move one step back in the history.

(
        self,
        start: bool = True,
        search: bool = False,
        target: str | None = None,
        include_current: bool = False,
    )

Source from the content-addressed store, hash-verified

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:

Callers 9

handle_inputMethod · 0.80
test_backMethod · 0.80
test_appendMethod · 0.80
test_enterMethod · 0.80
test_enter_2Method · 0.80
test_resetMethod · 0.80
get_last_wordMethod · 0.80
incremental_searchMethod · 0.80
up_one_lineMethod · 0.80

Calls 2

find_match_backwardMethod · 0.95

Tested by 5

test_backMethod · 0.64
test_appendMethod · 0.64
test_enterMethod · 0.64
test_enter_2Method · 0.64
test_resetMethod · 0.64