Skip to content

CodeMirrorModule.countColumn method

CodeMirrorModule › countColumn

Unofficial

Finds the column position at a given string index using a given tab size.

Signature:

countColumn(line: string, index: number | null, tabSize: number): number

Parameters:

ParameterTypeDescription
linestringThe line string.
indexnumber | nullThe string index (or null for end of line).
tabSizenumberThe tab size.

Returns: numberThe column number.