3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48:29 +01:00

Name edgeDepth's parameter apart from runsBeside

This commit is contained in:
2026-11-03 22:37:43 +01:00
committed by Lillem4n
parent d76d4c9440
commit 763d68ba03
+3 -3
View File
@@ -215,11 +215,11 @@ function leafEdges(leaf: AdfNode, runsBefore: number | undefined, runsAfter: num
}
// How many of the leaf's marks the edge whitespace keeps, `undefined` where it drops at a line edge.
function edgeDepth(marks: readonly AdfMark[], runsBeside: number | undefined, whitespace: string): number | undefined {
function edgeDepth(marks: readonly AdfMark[], sharedRuns: number | undefined, whitespace: string): number | undefined {
if (whitespace === '') return marks.length
const stripping = marks.findIndex((mark, index) => index >= (runsBeside ?? 0) && edgeStrippingMarks.includes(mark.type))
const stripping = marks.findIndex((mark, index) => index >= (sharedRuns ?? 0) && edgeStrippingMarks.includes(mark.type))
const kept = stripping === -1 ? marks.length : stripping
return kept === 0 && runsBeside === undefined ? undefined : kept
return kept === 0 && sharedRuns === undefined ? undefined : kept
}
function spellableLine(leaves: AdfNode[], container: LineContainer, path: ConvertErrorPath): Result<AdfNode[]> {