MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / getDisplayLineMap

Function getDisplayLineMap

src/util/getDisplayLineMap.ts:12–28  ·  view source on GitHub ↗
(editor: vscode.TextEditor)

Source from the content-addressed store, hash-verified

10 * @param editor A visible editor
11 */
12export function getDisplayLineMap(editor: vscode.TextEditor) {
13 return new Map(
14 flow(
15 flatten,
16 uniq
17 )(
18 concat(
19 [[editor.selection.start.line]],
20 editor.visibleRanges.map((visibleRange) =>
21 range(visibleRange.start.line, visibleRange.end.line + 1)
22 )
23 )
24 )
25 .sort((a, b) => a - b)
26 .map((value, index) => [value, index])
27 );
28}

Callers 1

addDecorationsToEditorsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected