MarkerManager

new MarkerManager(markerList)

Parameters:
Name Type Description
markerList MarkerList

MarkerList object

Methods

_calculateEndDiff(start, end, diff, marker) → {number}

_calculateEndDiff
Calculate end diff

Parameters:
Name Type Description
start number

change start offset

end number

change end offset

diff number

diff count of change

marker object

marker to calculate diff

Returns:
number -

end diff of marker

_calculateStartDiff(start, end, diff, marker) → {number}

_calculateStartDiff
Calculate start diff

Parameters:
Name Type Description
start number

change start offset

end number

change end offset

diff number

diff count of change

marker object

marker to calculate diff

Returns:
number -

start diff of marker

_forEachChanges(newContent, iteratee)

_forEachChanges
Iterate each change of updated content

Parameters:
Name Type Description
newContent string

updated content

iteratee function

iteratee

_getUpdateMarkersWithDiffs(markerDiffs) → {Array.<object>}

_getUpdateMarkersWithDiffs
Get updated markers with diffs

Parameters:
Name Type Description
markerDiffs object

marker diff object that contains diff info of specific marker

Returns:
Array.<object> -

updated markers

_makeMarkerDiffs(newContent) → {object}

_makeMarkerDiffs
Make diffs of marker by updated content

Parameters:
Name Type Description
newContent string

updated content

Returns:
object -

marker diffs

resetContent(content)

resetContent
Reset content

Parameters:
Name Type Description
content string

reset base content

updateMarkersByContent(newContent) → {object}

uppdateMarkersByContent
Get updated markers by updated content

Parameters:
Name Type Description
newContent string

updated content

Returns:
object -

updated markers