Module: util/getTokenComparator
Functions
getTokenComparator
▸ getTokenComparator(selectionDisplayLine, selectionCharacterIndex): (a: Token, b: Token) => number
Gets a comparison function that can be used to sort tokens based on their distance from the current cursor in terms of display lines.
Parameters
| Name | Type | Description |
|---|---|---|
selectionDisplayLine | number | The display line of the cursor location |
selectionCharacterIndex | number | The character index of current cursor within line |
Returns
fn
▸ (a, b): number
Gets a comparison function that can be used to sort tokens based on their distance from the current cursor in terms of display lines.
Parameters
| Name | Type |
|---|---|
a | Token |
b | Token |
Returns
number
Defined in
util/getTokenComparator.ts:9