Skip to content

Doc.eachLine method

Doc › eachLine

Unofficial

Iterate over the whole document, calling f for each line.

Signature:

eachLine(f: (line: Cm5LineHandle) => void): void

Parameters:

ParameterTypeDescription
f(line: Cm5LineHandle) => voidThe function to call for each line.

Returns: void


Unofficial

Iterate over a range of lines.

Signature:

eachLine(start: number, end: number, f: (line: Cm5LineHandle) => void): void

Parameters:

ParameterTypeDescription
startnumberThe start line number.
endnumberThe end line number (exclusive).
f(line: Cm5LineHandle) => voidThe function to call for each line.

Returns: void