Skip to content

Editor.iterateSelectedLines method

Editor › iterateSelectedLines

Unofficial

Iterate the line numbers covered by the given selections, each line once.

Signature:

iterateSelectedLines(selections: EditorSelection[], skipEmpty: boolean): Generator<number, void, undefined>

Parameters:

ParameterTypeDescription
selectionsEditorSelection[]The selections whose lines to iterate.
skipEmptybooleanWhether to skip blank lines when the selections span more than one line.

Returns: Generator<number, void, undefined> — A generator of 0-indexed line numbers.