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

bundles / IPython 9.12.0 / IPython / core / completer / cursor_to_position

function

IPython.core.completer:cursor_to_position

source: /IPython/core/completer.py :1644

Signature

def   cursor_to_position ( text : str line : int column : int )  →  int

Summary

Convert the (line,column) position of the cursor in text to an offset in a string.

Parameters

text : str

The text in which to calculate the cursor offset

line : int

Line of the cursor; 0-indexed

column : int

Column of the cursor 0-indexed

Returns

: Position of the cursor in ``text``, 0-indexed.

See also

position_to_cursor

reciprocal of this function

Aliases

  • IPython.core.completer.cursor_to_position