MCPcopy Index your code
hub / github.com/ipython/ipython / raw_string_braces

Function raw_string_braces

IPython/terminal/shortcuts/auto_match.py:76–84  ·  view source on GitHub ↗

Auto-close braces in raw strings

(event: KeyPressEvent)

Source from the content-addressed store, hash-verified

74
75
76def raw_string_braces(event: KeyPressEvent):
77 """Auto-close braces in raw strings"""
78 matches = re.match(
79 r".*(r|R)[\"'](-*)",
80 event.current_buffer.document.current_line_before_cursor,
81 )
82 dashes = matches.group(2) if matches else ""
83 event.current_buffer.insert_text("{}" + dashes)
84 event.current_buffer.cursor_left(len(dashes) + 1)
85
86
87def skip_over(event: KeyPressEvent):

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
groupMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…