You are viewing an older version (9.5.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.5.0 / IPython / utils / tokenutil / line_at_cursor

function

IPython.utils.tokenutil:line_at_cursor

source: /IPython/utils/tokenutil.py :63

Signature

def   line_at_cursor ( cell : str cursor_pos : int = 0 )  →  tuple[str, int]

Summary

Return the line in a cell at a given cursor position

Extended Summary

Used for calling line-based APIs that don't support multi-line input, yet.

Parameters

cell : str

multiline block of text

cursor_pos : integer

the cursor position

Returns

: (line, offset): (string, integer)

The line with the current cursor, and the character offset of the start of the line.

Aliases

  • IPython.utils.tokenutil.line_at_cursor