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

Method substitute_cseq

bpython/repl.py:286–301  ·  view source on GitHub ↗

Returns a new line by substituting a common sequence in, and update matches

(self)

Source from the content-addressed store, hash-verified

284 )
285
286 def substitute_cseq(self) -> tuple[int, str]:
287 """Returns a new line by substituting a common sequence in, and update
288 matches"""
289 assert self.completer is not None
290
291 cseq = os.path.commonprefix(self.matches)
292 new_cursor_offset, new_line = self.substitute(cseq)
293 if len(self.matches) == 1:
294 self.clear()
295 else:
296 self.update(
297 new_cursor_offset, new_line, self.matches, self.completer
298 )
299 if len(self.matches) == 1:
300 self.clear()
301 return new_cursor_offset, new_line
302
303 def update(
304 self,

Callers 3

tabMethod · 0.80
completeMethod · 0.80
on_tabMethod · 0.80

Calls 3

substituteMethod · 0.95
clearMethod · 0.95
updateMethod · 0.95

Tested by

no test coverage detected