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

Method current_line_formatted

bpython/curtsiesfrontend/repl.py:1418–1446  ·  view source on GitHub ↗

The colored current line (no prompt, not wrapped)

(self)

Source from the content-addressed store, hash-verified

1416
1417 @property
1418 def current_line_formatted(self):
1419 """The colored current line (no prompt, not wrapped)"""
1420 if self.config.syntax:
1421 fs = bpythonparse(
1422 pygformat(self.tokenize(self.current_line), self.formatter)
1423 )
1424 if self.incr_search_mode != SearchMode.NO_SEARCH:
1425 if self.incr_search_target in self.current_line:
1426 fs = fmtfuncs.on_magenta(self.incr_search_target).join(
1427 fs.split(self.incr_search_target)
1428 )
1429 elif (
1430 self.rl_history.saved_line
1431 and self.rl_history.saved_line in self.current_line
1432 ):
1433 if (
1434 self.config.curtsies_right_arrow_completion
1435 and self.rl_history.index != 0
1436 ):
1437 fs = fmtfuncs.on_magenta(self.rl_history.saved_line).join(
1438 fs.split(self.rl_history.saved_line)
1439 )
1440 logger.debug("Display line %r -> %r", self.current_line, fs)
1441 else:
1442 fs = fmtstr(self.current_line)
1443 if hasattr(self, "old_fs") and str(fs) != str(self.old_fs):
1444 pass
1445 self.old_fs = fs
1446 return fs
1447
1448 @property
1449 def lines_for_display(self):

Callers

nothing calls this directly

Calls 1

tokenizeMethod · 0.80

Tested by

no test coverage detected